C++0x lambdas with template parameters? [duplicate]
Asked Answered
S

1

6

Possible Duplicate:
Can lambda functions be templated?

Is it possible to have a c++0x lambda with template parameters? For example:

template <typename T> [=](const T *x) {}

What I am trying to do is to code a static for loop on a type list (variadic argument list), and I want to pass the current type as a parameter to to the operator () of the target functor (or lambda).

Souse answered 8/11, 2010 at 14:6 Comment(0)
C
1

That's called polymorphic lambda, I already asked about it there : Can lambda functions be templated?

And no it's not possible in C++0x. Maybe the next one.

However boost::phoenix allows this so it might be a good workaround.

Clower answered 8/11, 2010 at 14:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.