Код: Выделить всё
// with superfluous argument `this`, less efficient.
auto fn1 = [](int a, int b) { return a + b; };
// no argument `this`, more efficient!
auto fn2 = [](int a, int b) static { return a + b; };
Почему стандарт C++ неявно не определяет ничего не захватывающую лямбду как статическую
code> по умолчанию?
Подробнее здесь: https://stackoverflow.com/questions/793 ... hing-as-st
Мобильная версия