I am trying to work with lambda in C ++ after using them in C #. I currently have a boot tuple (this is a really simplified version).
typedef shared_ptr<Foo> (*StringFooCreator)(std::string, int, bool) typedef tuple<StringFooCreator> FooTuple
Then I load the function into the global namespace in my FooTuple. Ideally, I would like to replace this with a lambda.
tuplearray[i] = FooTuple([](string bar, int rc, bool eom) -> {return shared_ptr<Foo>(new Foo(bar, rc, eom));});
I can't figure out what the function signature for the lambda tuple should be. Obviously, this is not a pointer to a function, but I cannot understand what a lambda signature is. Resources for lambda are pretty thin right now. I understand that C ++ 0x is now on the move, but I was curious how to make this work. I also understand that there are simpler ways to do this, but I'm just playing with C ++ 0x. I am using the Intel 11.1 compiler.
c ++ boost lambda c ++ 11 tuples
Steve
source share