//In c++14 using static_cast / const_cast: [&best_string = static_cast<const std::string&>(best_string)](const string& s) { best_string = s; // fails };