How do I use const qualifier with decltype for template-ed function ?
Current GCC rejects following :
template <typename It>
bool process(It first , It last )
{
return std::all_of( first, last,
[]( const decltype(*first)& i )
// ^^^^^ without const it works fine
{
return i % 2 == 0;
}
) ;
}
Is it legal/possible to use i as const reference inside the lambda ?