c++ - Difference between const auto and auto for lambdas -
is there (useful?) difference between:
auto test = [..](..){..}; and
const auto test = [..](..){..}; ?
yes, if lambda declared mutable cannot call in second case.
int x = 0; const auto test = [x]() mutable { ++x; }; test(); // error
Comments
Post a Comment