Horje
Lambda capture as const cpp Code Example
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
};
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
};




Cpp

Related
std::random_device Code Example std::random_device Code Example
1822. Sign of the Product of an Array leetcode in c++ Code Example 1822. Sign of the Product of an Array leetcode in c++ Code Example
c++ read entire file into a variable Code Example c++ read entire file into a variable Code Example
convert char to string c++ Code Example convert char to string c++ Code Example
1162261467 Code Example 1162261467 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8