December 1st, 2014, 3:24 am
QuoteOriginally posted by: lballabioQuoteOriginally posted by: outrunFor the sake of good understanding and people not learning wrong things from a technical quiz: The captured variables *are* function objects!Correct. the lambda is actually an instance of some kind of anonymous class, internally defined by the constructor, that stores the captured variables as data members.auto (and std::function) walk like a function, talks like a function, kwaks like a function. So it is a function...yes?... or is there some conspiracy here QuoteClass template std::function is a general-purpose polymorphic function wrapper. Instances of std::function can store, copy, and invoke any Callable target -- functions, lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and pointers to data members. .NET delegates are built on a similar principle.
Last edited by
Cuchulainn on November 30th, 2014, 11:00 pm, edited 1 time in total.