I want to know what [=] does? Here is a quick example
template <typename T> std::function<T (T)> makeConverter(T factor, T offset) { return [=] (T input) -> T { return (offset + input) * factor; }; } auto milesToKm = makeConverter(1.60936, 0.0);
How will the code work with [] instead of [=] ?
I suppose that
std::function<T (T)>
means a prototype function that takes (T) as an argument and returns a type T ?
c ++ lambda c ++ 11
der_lord Jan 13 '16 at 22:08 2016-01-13 22:08
source share