mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
ES.28: drop broken and unnecessary example, closes #1590
This commit is contained in:
@@ -10972,16 +10972,6 @@ It nicely encapsulates local initialization, including cleaning up scratch varia
|
|||||||
return val;
|
return val;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
##### Example
|
|
||||||
|
|
||||||
string var = [&] {
|
|
||||||
if (!in) return ""; // default
|
|
||||||
string s;
|
|
||||||
for (char c : in >> c)
|
|
||||||
s += toupper(c);
|
|
||||||
return s;
|
|
||||||
}(); // note ()
|
|
||||||
|
|
||||||
If at all possible, reduce the conditions to a simple set of alternatives (e.g., an `enum`) and don't mix up selection and initialization.
|
If at all possible, reduce the conditions to a simple set of alternatives (e.g., an `enum`) and don't mix up selection and initialization.
|
||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|||||||
Reference in New Issue
Block a user