I'm confused about the use of square brackets around [funcParam] in the C++11 code segment below:
typedef std::function<std::vector<OtherType> ()> FuncPtr;
inline void create(FuncPtr funcParam)
{
auto create_evaluator = [funcParam] ()
{
return anotherFunction(funcParam());
};
// ...
}
The code above it called by this line (somewhat simplified to keep it readable):
create( [] () { return CONSTANT; } );
Can someone explain the use of brackets in both situations? In the calling code, it looks to be used to create a function without a name. What's it doing in the first segment? Thanks!