BoundedType

Complete at the point of variant template
instantiation. (See
boost::recursive_wrapper<T>
for a type wrapper that accepts incomplete types to enable recursive
variant types.)

Every type specified as a template argument to
variant must at minimum fulfill the
above requirements. In addition, certain features of variant
are available only if its bounded types meet the requirements of these
following additional concepts:

Assignable:
variant is itself Assignable if and
only if every one of its bounded types meets the requirements of the
concept. (Note that top-level const-qualified types and
reference types do not meet these
requirements.)

MoveAssignable:
variant is itself MoveAssignable if and
only if every one of its bounded types meets the requirements of the
concept. (Note that top-level const-qualified types and
reference types do not meet these
requirements.)

DefaultConstructible [20.1.4]:
variant is itself
DefaultConstructible if and only if its first
bounded type (i.e., T1) meets the requirements of the
concept.

EqualityComparable:
variant is itself EqualityComparable
if and only if every one of its bounded types meets the requirements
of the concept.

LessThanComparable:
variant is itself LessThanComparable
if and only if every one of its bounded types meets the requirements
of the concept.

OutputStreamable:
variant is itself OutputStreamable
if and only if every one of its bounded types meets the requirements
of the concept.

Hashable:
variant is itself Hashable
if and only if every one of its bounded types meets the requirements
of the concept.

Another example is the following class, whose function-call
operator is a member template, allowing it to operate on values of many
types. Thus, the following class is a visitor of any type that supports
streaming output (e.g., int, double,
std::string, etc.):