diff --git a/doc/html/variant2.html b/doc/html/variant2.html index bec6d59..918dab2 100644 --- a/doc/html/variant2.html +++ b/doc/html/variant2.html @@ -445,7 +445,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
This library implements a type-safe discriminated/tagged union type,
variant<T…>
, that is API-compatible with the C++17 Standard’s
@@ -515,6 +526,9 @@ equivalent to
Variants can be used to represent dynamically-typed values. A configuration file of the form
@@ -650,6 +664,9 @@ int main() }If we look at the
and the standard overload resolution rules are used to pick the one that will
be used. So variant<int, float>((short)1)
will hold an int
.
Putting values into a variant
is easy, but taking them out is necessarily a
bit more convoluted. It’s not possible for variant<int, float>
to define a
@@ -765,6 +785,9 @@ the following lines:
Last but not least, there’s visit
. visit(f, v)
calls the a function object
f
with the value contained in the variant
v
and returns the result. When
@@ -819,6 +842,9 @@ example:
f(x1, x2)
, where x1
is the value contained in v1
and x2
is the value
in v2
.
The default constructor of variant
value-initializes the first type in
the list. variant<int, float>{}
holds 0
(of type int
), and
@@ -834,6 +860,7 @@ which is basically a no-op, as monostate
is effectively an empty