Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Lambda capture as const cpp

//In c++14 using static_cast / const_cast:

[&best_string = static_cast<const std::string&>(best_string)](const string& s)
{
    best_string = s; // fails
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Lambda #capture #const #cpp
ADD COMMENT
Topic
Name
2+2 =