This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-10-26
Consider:
template<typename Iter> void f(Iter a, Iter b) { const int v = 10; auto do_something = [&] (auto thing) { if constexpr (is_random_access_iterator<Iter> && is_integral<decltype(thing)>) *(a + 1) = v; }; do_something(5); do_something("foo"); }
Determining whether v is captured requires instantiating the "if constexpr", but that results in a hard error for a statement that will eventually be discarded.
Rationale (February, 2018):
These questions were resolved by the adoption of paper P0588R1 at the November, 2017 meeting.