I'm trying to initialize templated class member with a lambda, via the constructor, like this.
#include <functional>
template<typename T>
class lambda_template_class {
public:
lambda_template_class(std::function<T(T)>& f) { }
};
class test {
protected:
lambda_template_class<int> member{ [] (int x) { return x; } };
};
int main() {
test t;
}
But it does not seem to accept any syntax. Is there a simple way to make this work?