Код: Выделить всё
std::shared_ptr s;
auto bla = [s]() {
s.reset();
};
Компиляция этого с помощью VS дает следующее ошибка:
Код: Выделить всё
error C2662: 'void std::shared_ptr::reset(void) noexcept': cannot convert 'this' pointer from 'const std::shared_ptr' to 'std::shared_ptr &'
1>...: message : Conversion loses qualifiers
Подробнее здесь: https://stackoverflow.com/questions/631 ... da-capture
Мобильная версия