Safe, generic, stack-based discriminated union container. The variant class template (inspired by Andrei Alexandrescu's class of the same name [Ale01A]) is an efficient, recursive-capable, bounded discriminated union value type capable of containing any value type (either POD or non-POD). It supports construction from any type convertible to one of its bounded types or from a source variant whose bounded types are each convertible to one of the destination variant's bounded types. As well, through apply_visitor, variant supports compile-time checked, type-safe visitation; and through get, variant supports run-time checked, type-safe value retrieval. Notes: All members of variant satisfy at least the basic guarantee of exception-safety. That is, all operations on a variant remain defined even after previous operations have failed. Each type specified as a template argument to variant must meet the requirements of the BoundedType concept. Each type specified as a template argument to variant must be distinct. For instance, use of variant<int, int> or variant<int, const int> results in undefined behavior. Conforming implementations of variant must allow at least ten types as template arguments. The exact number of allowed arguments is exposed by the preprocessor macro BOOST_VARIANT_LIMIT_TYPES. The following syntax is also supported: variant< type-sequence >, where type-sequence must meet the requirements of the MPL's Sequence concept. For instance, variant< mpl::list<int, std::string> > is functionally equivalent to variant< int, std::string >. (Due to standard conformance problems in several compilers, however, this syntax may not be supported on your compiler. See BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT for more information.) unspecified T1, T2, ..., TN as an MPL-compatible Sequence. Destroys the content of *this. Will not throw. The first bounded type of the variant (i.e., T1) must fulfill the requirements of the DefaultConstructible [20.1.4] concept. Content of *this is the default value of the first bounded type (i.e, T1). May fail with any exceptions arising from the default constructor of T1. const variant & Content of *this is a copy of the content of other. May fail with any exceptions arising from the copy constructor of other's contained type. T & T must be unambiguously convertible to one of the bounded types (i.e., T1, T2, etc.). Content of *this is the best conversion of operand to one of the bounded types, as determined by standard overload resolution rules. May fail with any exceptions arising from the conversion of operand to one of the bounded types. const T & Same semantics as previous constructor, but allows construction from temporaries. variant<U1, U2, ..., UN> & Every one of U1, U2, ..., UN must have an unambiguous conversion to one of the bounded types (i.e., T1, T2, ..., TN). If variant<U1, U2, ..., UN> is itself one of the bounded types, then content of *this is a copy of operand. Otherwise, content of *this is the best conversion of the content of operand to one of the bounded types, as determined by standard overload resolution rules. If variant<U1, U2, ..., UN> is itself one of the bounded types, then may fail with any exceptions arising from the copy constructor of variant<U1, U2, ..., UN>. Otherwise, may fail with any exceptions arising from the conversion of the content of operand to one of the bounded types. const variant<U1, U2, ..., UN> & Same semantics as previous constructor, but allows construction from temporaries. void variant & Every bounded type must fulfill the requirements of the Assignable concept. Interchanges the content of *this and other. If the contained type of other is the same as the contained type of *this, then may fail with any exceptions arising from the swap of the contents of *this and other. Otherwise, may fail with any exceptions arising from either of the copy constructors of the contained types. variant & const variant & Every bounded type must fulfill the requirements of the Assignable concept. If the contained type of rhs is the same as the contained type of *this, then assigns the content of rhs into the content of *this. Otherwise, makes the content of *this a copy of the content of rhs, destroying the previous content of *this. If the contained type of rhs is the same as the contained type of *this, then may fail with any exceptions arising from the assignment of the content of rhs into the content *this. Otherwise, may fail with any exceptions arising from the copy constructor of the contained type of rhs. variant & const T & T must be unambiguously convertible to one of the bounded types (i.e., T1, T2, etc.). Every bounded type must fulfill the requirements of the Assignable concept. If the contained type of *this is T, then assigns rhs into the content of *this. Otherwise, makes the content of *this the best conversion of rhs to one of the bounded types, as determined by standard overload resolution rules, destroying the previous content of *this. If the contained type of *this is T, then may fail with any exceptions arising from the assignment of rhs into the content *this. Otherwise, may fail with any exceptions arising from the conversion of rhs to one of the bounded types. int The zero-based index into the set of bounded types of the contained type of *this. (For instance, if called on a variant<int, std::string> object containing a std::string, which() would return 1.) Will not throw. bool true if and only if the contained type of *this is boost::empty. Will not throw. const std::type_info & typeid(x), where x is the the content of *this. Will not throw. void variant<T1, T2, ..., TN> & variant<T1, T2, ..., TN> & Swaps lhs with rhs by application of variant::swap. May fail with any exception arising from variant::swap. std::basic_ostream<ElemType,Traits> & std::basic_ostream<ElemType,Traits> & const variant<T1, T2, ..., TN> & Every bounded type of the variant must fulfill the requirements of the OutputStreamable concept. Calls out << x, where x is the content of rhs.