This patch enables the following code:
auto L = [](int i) { return i; }; constexpr int (*fpi)(int) = L; static_assert(fpi(3) == 3);
Differential D22997
[cxx1z-constexpr-lambda] Make conversion function constexpr, and teach the expression-evaluator to evaluate the static-invoker. faisalv on Jul 30 2016, 7:04 PM. Authored by
Details This patch enables the following code: auto L = [](int i) { return i; }; constexpr int (*fpi)(int) = L; static_assert(fpi(3) == 3);
Diff Detail
Event TimelineComment Actions Addressed Aaron's requests regarding improving formatting and assert messages. Thanks!
Comment Actions Simplify the check for zero captures in a lambda expression (within the assert) by comparing the begin and end pointers directly (as opposed to using distance) - thanks to Akira! |
Nit: remove new line.