Indeed, one could just as well try to write the following, only to be puzzled by a compiler error:
std::vector<int> v{1,2,3,4}; using Iterator = decltype(std::find_if(begin(v), end(v), [](int i) {return i % 2 == 0; }));While this is a valid use case, it is expected that using decltype on such a complex expression is less frequent outside the realm of heterogeneous computations.
On 2016–03–08, at 1:19 AM, David Krauss <pot...@gmail.com> wrote:It might be a good idea to preserve some restriction against a decltype specifier having a type “depending” on an embedded lambda closure. It’s my bedtime right now and I don’t suppose it would be easy to specify, though.