c++ - C++14 combining generic lambdas and variable templates -


i know generic lambdas, , know variable templates, but, do? allowed?

template<typename t> auto f = [](auto a, t b){ /**/ }; 

if it's allowed, can used expected? is, f<type>(var_a, var_b)?

a variable template must declared constexpr. lambda cannot occur in constant-expression, initialisation not allowed, , operator() not declared constexpr, calling isn't allowed.

in summary, ill-formed in current c++14 draft.

note: curiously, though lambda-expression cannot occur in constant-expression, seems closure type of lambda may have constexpr copy/move constructor.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -