Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Lambda capture as const cpp

//In c++17 using std::as_const:

[&best_string = std::as_const(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+4 =