Created on 2016-06-20.00:00:00 last changed 81 months ago
Rationale (February, 2018):
These questions were resolved by the adoption of paper P0588R1 at the November, 2017 meeting.
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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-02-27 00:00:00 | admin | set | messages: + msg6011 |
2018-02-27 00:00:00 | admin | set | status: open -> nad |
2016-06-20 00:00:00 | admin | create |