mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 04:44:34 +03:00
Closes #1332
This commit is contained in:
@@ -8486,7 +8486,7 @@ And, talking about "invisible", this code produced no output:
|
|||||||
|
|
||||||
Wrap a `union` in a class together with a type field.
|
Wrap a `union` in a class together with a type field.
|
||||||
|
|
||||||
The soon-to-be-standard `variant` type (to be found in `<variant>`) does that for you:
|
The C++17 `variant` type (found in `<variant>`) does that for you:
|
||||||
|
|
||||||
variant<int, double> v;
|
variant<int, double> v;
|
||||||
v = 123; // v holds an int
|
v = 123; // v holds an int
|
||||||
|
|||||||
Reference in New Issue
Block a user