1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <!DOCTYPE header PUBLIC
"-//Boost//DTD BoostBook XML V1.0//EN"
3 "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
5 Copyright 2003, Eric Friedman, Itay Maman.
7 Distributed under the Boost Software License, Version 1.0. (See accompanying
8 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 <header name=
"boost/variant/variant.hpp">
11 <namespace name=
"boost">
12 <class name=
"variant">
13 <purpose>Safe, generic, stack-based discriminated union container.
</purpose>
15 <simpara>The
<code>variant
</code> class template (inspired by Andrei
16 Alexandrescu's class of the same name
17 [
<link linkend=
"variant.refs.ale01a">Ale01A
</link>]) is an efficient,
18 <link linkend=
"variant.tutorial.recursive">recursive-capable
</link>,
19 bounded discriminated union value type capable of containing any value
20 type (either POD or non-POD). It supports construction from any type
21 convertible to one of its bounded types or from a source
22 <code>variant
</code> whose bounded types are each convertible to one
23 of the destination
<code>variant
</code>'s bounded types. As well,
24 through
<code><functionname>apply_visitor
</functionname></code>,
25 <code>variant
</code> supports compile-time checked, type-safe
26 visitation; and through
<code><functionname>get
</functionname></code>,
27 <code>variant
</code> supports run-time checked, type-safe value
30 <simpara><emphasis role=
"bold">Notes
</emphasis>:
</simpara>
32 <listitem>The bounded types of the
<code>variant
</code> are exposed
33 via the nested typedef
<code>types
</code>, which is an
34 <libraryname>MPL
</libraryname>-compatible Sequence containing the
35 set of types that must be handled by any
36 <link linkend=
"variant.concepts.static-visitor">visitor
</link> to
37 the
<code>variant
</code>.
</listitem>
38 <listitem>All members of
<code>variant
</code> satisfy at least the
39 basic guarantee of exception-safety. That is, all operations on
40 a
<code>variant
</code> remain defined even after previous
41 operations have failed.
</listitem>
42 <listitem>Each type specified as a template argument to
43 <code>variant
</code> must meet the requirements of the
44 <emphasis><link linkend=
"variant.concepts.bounded-type">BoundedType
</link></emphasis>
46 <listitem>Each type specified as a template argument to
47 <code>variant
</code> must be distinct after removal of qualifiers.
48 Thus, for instance, both
<code>variant
<int, int
></code> and
49 <code>variant
<int, const int
></code> have undefined
51 <listitem>Conforming implementations of
<code>variant
</code> must
52 allow at least ten types as template arguments. The exact number
53 of allowed arguments is exposed by the preprocessor macro
54 <code><macroname>BOOST_VARIANT_LIMIT_TYPES
</macroname></code>.
55 (See
<code><classname>make_variant_over
</classname></code> for a
56 means to specify the bounded types of a
<code>variant
</code> by
57 the elements of an
<libraryname>MPL
</libraryname> or compatible
58 Sequence, thus overcoming this limitation.)
</listitem>
63 <template-type-parameter name=
"T1"/>
64 <template-type-parameter name=
"T2">
65 <default><emphasis>unspecified
</emphasis></default>
66 </template-type-parameter>
68 <template-type-parameter name=
"TN">
69 <default><emphasis>unspecified
</emphasis></default>
70 </template-type-parameter>
73 <typedef name=
"types">
74 <type><emphasis>unspecified
</emphasis></type>
79 <simpara>Destroys the content of
<code>*this
</code>.
</simpara>
82 <throws>Will not throw.
</throws>
87 <simpara>The first bounded type of the
<code>variant
</code> (i.e.,
88 <code>T1
</code>) must fulfill the requirements of the
89 <emphasis>DefaultConstructible
</emphasis> [
20.1.4]
94 <simpara>Content of
<code>*this
</code> is the default value of the
95 first bounded type (i.e,
<code>T1
</code>).
</simpara>
99 <simpara>May fail with any exceptions arising from the default
100 constructor of
<code>T1
</code>.
</simpara>
105 <parameter name=
"other">
106 <paramtype>const variant
&</paramtype>
110 <simpara>Content of
<code>*this
</code> is a copy of the content of
111 <code>other
</code>.
</simpara>
115 <simpara>May fail with any exceptions arising from the
116 copy constructor of
<code>other
</code>'s contained type.
</simpara>
121 <parameter name=
"other">
122 <paramtype>variant
&&</paramtype>
126 <simpara>C++
11 compatible compiler.
</simpara>
130 <simpara>Content of
<code>*this
</code> is move constructed from the content of
131 <code>other
</code>.
</simpara>
135 <simpara>May fail with any exceptions arising from the
136 move constructor of
<code>other
</code>'s contained type.
</simpara>
142 <template-type-parameter name=
"T"/>
145 <parameter name=
"operand">
146 <paramtype>T
&</paramtype>
150 <simpara><code>T
</code> must be unambiguously convertible to one of
151 the bounded types (i.e.,
<code>T1
</code>,
<code>T2
</code>,
156 <simpara>Content of
<code>*this
</code> is the best conversion of
157 <code>operand
</code> to one of the bounded types, as determined
158 by standard overload resolution rules.
</simpara>
162 <simpara>May fail with any exceptions arising from the conversion of
163 <code>operand
</code> to one of the bounded types.
</simpara>
169 <template-type-parameter name=
"T"/>
172 <parameter name=
"operand">
173 <paramtype>const T
&</paramtype>
177 <simpara>Same semantics as previous constructor, but allows
178 construction from temporaries.
</simpara>
184 <template-type-parameter name=
"T"/>
187 <parameter name=
"operand">
188 <paramtype>T
&&</paramtype>
192 <simpara>C++
11 compatible compiler.
</simpara>
196 <simpara>Same semantics as previous constructor, but allows
197 move construction if
<code>operand
</code> is an rvalue.
</simpara>
203 <template-type-parameter name=
"U1"/>
204 <template-type-parameter name=
"U2"/>
206 <template-type-parameter name=
"UN"/>
209 <parameter name=
"operand">
210 <paramtype>variant
<U1, U2, ..., UN
> &</paramtype>
214 <simpara><emphasis>Every
</emphasis> one of
<code>U1
</code>,
215 <code>U2
</code>, ...,
<code>UN
</code> must have an unambiguous
216 conversion to one of the bounded types (i.e.,
<code>T1
</code>,
217 <code>T2
</code>, ...,
<code>TN
</code>).
</simpara>
221 <simpara>If
<code>variant
<U1, U2, ..., UN
></code> is itself
222 one of the bounded types, then content of
<code>*this
</code> is a
223 copy of
<code>operand
</code>. Otherwise, content of
224 <code>*this
</code> is the best conversion of the content of
225 <code>operand
</code> to one of the bounded types, as determined
226 by standard overload resolution rules.
</simpara>
230 <simpara>If
<code>variant
<U1, U2, ..., UN
></code> is itself
231 one of the bounded types, then may fail with any exceptions arising
232 from the copy constructor of
233 <code>variant
<U1, U2, ..., UN
></code>. Otherwise, may fail
234 with any exceptions arising from the conversion of the content of
235 <code>operand
</code> to one of the bounded types.
</simpara>
241 <template-type-parameter name=
"U1"/>
242 <template-type-parameter name=
"U2"/>
244 <template-type-parameter name=
"UN"/>
247 <parameter name=
"operand">
248 <paramtype>const variant
<U1, U2, ..., UN
> &</paramtype>
252 <simpara>Same semantics as previous constructor, but allows
253 construction from temporaries.
</simpara>
259 <template-type-parameter name=
"U1"/>
260 <template-type-parameter name=
"U2"/>
262 <template-type-parameter name=
"UN"/>
266 <simpara>C++
11 compatible compiler.
</simpara>
269 <parameter name=
"operand">
270 <paramtype>variant
<U1, U2, ..., UN
> &&</paramtype>
274 <simpara>Same semantics as previous constructor, but allows
275 move construction.
</simpara>
279 <method-group name=
"modifiers">
284 <parameter name=
"other">
285 <paramtype>variant
&</paramtype>
289 <simpara>Every bounded type must fulfill the requirements of the
290 <conceptname>MoveAssignable
</conceptname>
295 <simpara>Interchanges the content of
<code>*this
</code> and
296 <code>other
</code>.
</simpara>
300 <simpara>If the contained type of
<code>other
</code> is the same as
301 the contained type of
<code>*this
</code>, then may fail with any
302 exceptions arising from the
<code>swap
</code> of the contents of
303 <code>*this
</code> and
<code>other
</code>. Otherwise, may fail
304 with any exceptions arising from either of the move or copy constructors
305 of the contained types. Also, in the event of insufficient
306 memory, may fail with
<code>std::bad_alloc
</code>
307 (
<link linkend=
"variant.design.never-empty.problem">why?
</link>).
</simpara>
311 <method name=
"operator=">
312 <type>variant
&</type>
314 <parameter name=
"rhs">
315 <paramtype>const variant
&</paramtype>
319 <simpara>Every bounded type must fulfill the requirements of the
320 <conceptname>Assignable
</conceptname>
325 <simpara>If the contained type of
<code>rhs
</code> is the same as
326 the contained type of
<code>*this
</code>, then assigns the
327 content of
<code>rhs
</code> into the content of
328 <code>*this
</code>. Otherwise, makes the content of
329 <code>*this
</code> a copy of the content of
<code>rhs
</code>,
330 destroying the previous content of
<code>*this
</code>.
</simpara>
334 <simpara>If the contained type of
<code>rhs
</code> is the same as
335 the contained type of
<code>*this
</code>, then may fail with any
336 exceptions arising from the assignment of the content of
337 <code>rhs
</code> into the content
<code>*this
</code>. Otherwise,
338 may fail with any exceptions arising from the copy constructor
339 of the contained type of
<code>rhs
</code>. Also, in the event of
340 insufficient memory, may fail with
<code>std::bad_alloc
</code>
341 (
<link linkend=
"variant.design.never-empty.problem">why?
</link>).
</simpara>
345 <method name=
"operator=">
346 <type>variant
&</type>
348 <parameter name=
"rhs">
349 <paramtype>variant
&&</paramtype>
354 <listitem>C++
11 compatible compiler.
</listitem>
355 <listitem>Every bounded type must fulfill the requirements of the
356 <conceptname>MoveAssignable
</conceptname>
362 <simpara>If the contained type of
<code>rhs
</code> is the same as
363 the contained type of
<code>*this
</code>, then move assigns the
364 content of
<code>rhs
</code> into the content of
365 <code>*this
</code>. Otherwise, move constructs
366 <code>*this
</code> using the content of
<code>rhs
</code>,
367 destroying the previous content of
<code>*this
</code>.
</simpara>
371 <simpara>If the contained type of
<code>rhs
</code> is the same as
372 the contained type of
<code>*this
</code>, then may fail with any
373 exceptions arising from the move assignment of the content of
374 <code>rhs
</code> into the content
<code>*this
</code>. Otherwise,
375 may fail with any exceptions arising from the move constructor
376 of the contained type of
<code>rhs
</code>. Also, in the event of
377 insufficient memory, may fail with
<code>std::bad_alloc
</code>
378 (
<link linkend=
"variant.design.never-empty.problem">why?
</link>).
</simpara>
382 <method name=
"operator=">
383 <type>variant
&</type>
386 <template-type-parameter name=
"T"/>
389 <parameter name=
"rhs">
390 <paramtype>const T
&</paramtype>
395 <listitem><code>T
</code> must be unambiguously convertible to
396 one of the bounded types (i.e.,
<code>T1
</code>,
397 <code>T2
</code>, etc.).
</listitem>
398 <listitem>Every bounded type must fulfill the requirements of the
399 <conceptname>Assignable
</conceptname>
405 <simpara>If the contained type of
<code>*this
</code> is
406 <code>T
</code>, then assigns
<code>rhs
</code> into the content
407 of
<code>*this
</code>. Otherwise, makes the content of
408 <code>*this
</code> the best conversion of
<code>rhs
</code> to
409 one of the bounded types, as determined by standard overload
410 resolution rules, destroying the previous content of
411 <code>*this
</code>.
</simpara>
415 <simpara>If the contained type of
<code>*this
</code> is
416 <code>T
</code>, then may fail with any exceptions arising from
417 the assignment of
<code>rhs
</code> into the content
418 <code>*this
</code>. Otherwise, may fail with any exceptions
419 arising from the conversion of
<code>rhs
</code> to one of the
420 bounded types. Also, in the event of insufficient memory, may
421 fail with
<code>std::bad_alloc
</code>
422 (
<link linkend=
"variant.design.never-empty.problem">why?
</link>).
</simpara>
426 <method name=
"operator=">
427 <type>variant
&</type>
430 <template-type-parameter name=
"T"/>
433 <parameter name=
"rhs">
434 <paramtype>T
&&</paramtype>
439 <listitem>C++
11 compatible compiler.
</listitem>
440 <listitem><code>rhs
</code> is an rvalue. Otherwise previous operator will be used.
</listitem>
441 <listitem><code>T
</code> must be unambiguously convertible to
442 one of the bounded types (i.e.,
<code>T1
</code>,
443 <code>T2
</code>, etc.).
</listitem>
444 <listitem>Every bounded type must fulfill the requirements of the
445 <conceptname>MoveAssignable
</conceptname>
451 <simpara>If the contained type of
<code>*this
</code> is
452 <code>T
</code>, then move assigns
<code>rhs
</code> into the content
453 of
<code>*this
</code>. Otherwise, makes the content of
454 <code>*this
</code> the best conversion of
<code>rhs
</code> to
455 one of the bounded types, as determined by standard overload
456 resolution rules, destroying the previous content of
457 <code>*this
</code>(conversion is usually done via move construction).
</simpara>
461 <simpara>If the contained type of
<code>*this
</code> is
462 <code>T
</code>, then may fail with any exceptions arising from
463 the move assignment of
<code>rhs
</code> into the content
464 <code>*this
</code>. Otherwise, may fail with any exceptions
465 arising from the conversion of
<code>rhs
</code> to one of the
466 bounded types. Also, in the event of insufficient memory, may
467 fail with
<code>std::bad_alloc
</code>
468 (
<link linkend=
"variant.design.never-empty.problem">why?
</link>).
</simpara>
474 <method-group name=
"queries">
476 <method name=
"which" cv=
"const">
480 <simpara>The zero-based index into the set of bounded types
481 of the contained type of
<code>*this
</code>. (For instance, if
482 called on a
<code>variant
<int, std::string
></code> object
483 containing a
<code>std::string
</code>,
<code>which()
</code>
484 would return
<code>1</code>.)
</simpara>
487 <throws>Will not throw.
</throws>
490 <method name=
"empty" cv=
"const">
494 <simpara><code>false
</code>:
<code>variant
</code> always contains
495 exactly one of its bounded types. (See
496 <xref linkend=
"variant.design.never-empty"/>
497 for more information.)
</simpara>
501 <simpara>Facilitates generic compatibility with
502 <classname>boost::any
</classname>.
</simpara>
505 <throws>Will not throw.
</throws>
508 <method name=
"type" cv=
"const">
509 <type>const std::type_info
&</type>
512 <simpara><code>boost::variant
</code> usues Boost.TypeIndex library so actually
513 <code>const boost::typeindex::type_info
&</code> is returned.
514 This method is available even if RTTI is off.
</simpara>
518 <simpara><code>typeid(x)
</code>, where
<code>x
</code> is the the
519 content of
<code>*this
</code>.
</simpara>
522 <throws>Will not throw.
</throws>
528 <method-group name=
"relational">
530 <overloaded-method name=
"operator==" cv=
"const">
531 <purpose>Equality comparison.
</purpose>
533 <signature cv=
"const">
535 <parameter name=
"rhs">
536 <paramtype>const variant
&</paramtype>
540 <signature cv=
"const">
543 <template-type-parameter name=
"U"/>
546 <paramtype>const U
&</paramtype>
551 <simpara>The overload returning
<code>void
</code> exists only to
552 prohibit implicit conversion of the operator's right-hand side
553 to
<code>variant
</code>; thus, its use will (purposefully)
554 result in a compile-time error.
</simpara>
558 <simpara>Every bounded type of the
<code>variant
</code> must
559 fulfill the requirements of the
560 <conceptname>EqualityComparable
</conceptname>
565 <simpara><code>true
</code> if
<code>which() == rhs.which()
</code>
566 <emphasis>and
</emphasis>
567 <code>content_this == content_rhs
</code>, where
568 <code>content_this
</code> is the content of
<code>*this
</code>
569 and
<code>content_rhs
</code> is the content of
570 <code>rhs
</code>.
</simpara>
574 <simpara>If
<code>which() == rhs.which()
</code> then may fail with
575 any exceptions arising from
<code>operator==(T,T)
</code>, where
576 <code>T
</code> is the contained type of
577 <code>*this
</code>.
</simpara>
581 <overloaded-method name=
"operator!=" cv=
"const">
582 <purpose>InEquality comparison.
</purpose>
584 <signature cv=
"const">
586 <parameter name=
"rhs">
587 <paramtype>const variant
&</paramtype>
591 <signature cv=
"const">
594 <template-type-parameter name=
"U"/>
597 <paramtype>const U
&</paramtype>
602 <simpara>The overload returning
<code>void
</code> exists only to
603 prohibit implicit conversion of the operator's right-hand side
604 to
<code>variant
</code>; thus, its use will (purposefully)
605 result in a compile-time error.
</simpara>
609 <simpara>Every bounded type of the
<code>variant
</code> must
610 fulfill the requirements of the
611 <conceptname>EqualityComparable
</conceptname>
616 <simpara><code>true
</code> if
<code>!(*this == rhs)
</code>.
</simpara>
620 <simpara>If
<code>which() == rhs.which()
</code> then may fail with
621 any exceptions arising from
<code>operator==(T,T)
</code>, where
622 <code>T
</code> is the contained type of
623 <code>*this
</code>.
</simpara>
627 <overloaded-method name=
"operator<">
628 <purpose>LessThan comparison.
</purpose>
630 <signature cv=
"const">
632 <parameter name=
"rhs">
633 <paramtype>const variant
&</paramtype>
637 <signature cv=
"const">
640 <template-type-parameter name=
"U"/>
643 <paramtype>const U
&</paramtype>
648 <simpara>The overload returning
<code>void
</code> exists only to
649 prohibit implicit conversion of the operator's right-hand side
650 to
<code>variant
</code>; thus, its use will (purposefully)
651 result in a compile-time error.
</simpara>
655 <simpara>Every bounded type of the
<code>variant
</code> must
656 fulfill the requirements of the
657 <conceptname>LessThanComparable
</conceptname>
662 <simpara>If
<code>which() == rhs.which()
</code> then:
663 <code>content_this
< content_rhs
</code>, where
664 <code>content_this
</code> is the content of
<code>*this
</code>
665 and
<code>content_rhs
</code> is the content of
<code>rhs
</code>.
666 Otherwise:
<code>which()
< rhs.which()
</code>.
</simpara>
670 <simpara>If
<code>which() == rhs.which()
</code> then may fail with
671 any exceptions arising from
<code>operator
<(T,T)
</code>,
672 where
<code>T
</code> is the contained type of
673 <code>*this
</code>.
</simpara>
678 <overloaded-method name=
"operator>">
679 <purpose>GreaterThan comparison.
</purpose>
681 <signature cv=
"const">
683 <parameter name=
"rhs">
684 <paramtype>const variant
&</paramtype>
688 <signature cv=
"const">
691 <template-type-parameter name=
"U"/>
694 <paramtype>const U
&</paramtype>
699 <simpara>The overload returning
<code>void
</code> exists only to
700 prohibit implicit conversion of the operator's right-hand side
701 to
<code>variant
</code>; thus, its use will (purposefully)
702 result in a compile-time error.
</simpara>
706 <simpara>Every bounded type of the
<code>variant
</code> must
707 fulfill the requirements of the
708 <conceptname>LessThanComparable
</conceptname>
713 <simpara>true if
<code>rhs
< *this
</code>.
</simpara>
717 <simpara>May fail with
718 any exceptions arising from
<code>operator
<(T,T)
</code>,
719 where
<code>T
</code> is the contained type of
720 <code>*this
</code>.
</simpara>
725 <overloaded-method name=
"operator<=">
726 <purpose>LessThan or Equal comparison.
</purpose>
728 <signature cv=
"const">
730 <parameter name=
"rhs">
731 <paramtype>const variant
&</paramtype>
735 <signature cv=
"const">
738 <template-type-parameter name=
"U"/>
741 <paramtype>const U
&</paramtype>
746 <simpara>The overload returning
<code>void
</code> exists only to
747 prohibit implicit conversion of the operator's right-hand side
748 to
<code>variant
</code>; thus, its use will (purposefully)
749 result in a compile-time error.
</simpara>
753 <simpara>Every bounded type of the
<code>variant
</code> must
754 fulfill the requirements of the
755 <conceptname>LessThanComparable
</conceptname>
760 <simpara>true if
<code>!(*this
> rhs)
</code>.
</simpara>
764 <simpara>May fail with
765 any exceptions arising from
<code>operator
<(T,T)
</code>,
766 where
<code>T
</code> is the contained type of
767 <code>*this
</code>.
</simpara>
772 <overloaded-method name=
"operator>=">
773 <purpose>GreaterThan or Equal comparison.
</purpose>
775 <signature cv=
"const">
777 <parameter name=
"rhs">
778 <paramtype>const variant
&</paramtype>
782 <signature cv=
"const">
785 <template-type-parameter name=
"U"/>
788 <paramtype>const U
&</paramtype>
793 <simpara>The overload returning
<code>void
</code> exists only to
794 prohibit implicit conversion of the operator's right-hand side
795 to
<code>variant
</code>; thus, its use will (purposefully)
796 result in a compile-time error.
</simpara>
800 <simpara>Every bounded type of the
<code>variant
</code> must
801 fulfill the requirements of the
802 <conceptname>LessThanComparable
</conceptname>
807 <simpara>true if
<code>!(*this
< lhs)
</code>.
</simpara>
811 <simpara>May fail with
812 any exceptions arising from
<code>operator
<(T,T)
</code>,
813 where
<code>T
</code> is the contained type of
814 <code>*this
</code>.
</simpara>
821 <function name=
"swap">
823 <template-type-parameter name=
"T1"/>
824 <template-type-parameter name=
"T2"/>
826 <template-type-parameter name=
"TN"/>
831 <parameter name=
"lhs">
832 <paramtype><classname>variant
</classname><T1, T2, ..., TN
> &</paramtype>
835 <parameter name=
"rhs">
836 <paramtype><classname>variant
</classname><T1, T2, ..., TN
> &</paramtype>
840 <simpara>Swaps
<code>lhs
</code> with
<code>rhs
</code> by application
841 of
<code><methodname>variant::swap
</methodname></code>.
</simpara>
845 <simpara>May fail with any exception arising from
846 <code><methodname>variant::swap
</methodname></code>.
</simpara>
850 <function name=
"operator<<">
851 <purpose>Provides streaming output for
<code>variant
</code> types.
</purpose>
854 <template-type-parameter name=
"ElemType"/>
855 <template-type-parameter name=
"Traits"/>
856 <template-type-parameter name=
"T1"/>
857 <template-type-parameter name=
"T2"/>
859 <template-type-parameter name=
"TN"/>
862 <type>std::basic_ostream
<ElemType,Traits
> &</type>
864 <parameter name=
"out">
865 <paramtype>std::basic_ostream
<ElemType,Traits
> &</paramtype>
868 <parameter name=
"rhs">
869 <paramtype>const
<classname>variant
</classname><T1, T2, ..., TN
> &</paramtype>
873 <simpara>Every bounded type of the
<code>variant
</code> must
874 fulfill the requirements of the
875 <link linkend=
"variant.concepts.output-streamable"><emphasis>OutputStreamable
</emphasis></link>
880 <simpara>Calls
<code>out
<< x
</code>, where
<code>x
</code> is
881 the content of
<code>rhs
</code>.
</simpara>
885 <simpara>Not available when
<code>BOOST_NO_IOSTREAM
</code> is
891 <function name=
"hash_value">
892 <purpose>Provides hashing for
<code>variant
</code> types so
893 that
<code>boost::hash
</code> may compute hash.
</purpose>
896 <template-type-parameter name=
"T1"/>
897 <template-type-parameter name=
"T2"/>
899 <template-type-parameter name=
"TN"/>
902 <type>std::size_t
</type>
904 <parameter name=
"rhs">
905 <paramtype>const
<classname>variant
</classname><T1, T2, ..., TN
> &</paramtype>
909 <simpara>Every bounded type of the
<code>variant
</code> must
910 fulfill the requirements of the
911 <link linkend=
"variant.concepts.hashable"><emphasis>Hashable
</emphasis></link>
916 <simpara>Calls
<code>boost::hash
<T
>()(x)
</code>, where
<code>x
</code> is
917 the content of
<code>rhs
</code> and
<code>T
</code> is its type.
</simpara>
921 <simpara>Actually, this function is defined in
922 <code><boost/variant/detail/hash_variant.hpp
></code>
928 <class name=
"make_variant_over">
930 <simpara>Exposes a
<code>variant
</code> whose bounded types are the
931 elements of the given type sequence.
</simpara>
935 <template-type-parameter name=
"Sequence"/>
938 <typedef name=
"type">
939 <type>variant
< <emphasis>unspecified
</emphasis> ></type>
943 <simpara><code>type
</code> has behavior equivalent in every respect to
944 <code><classname>variant
</classname>< Sequence[
0], Sequence[
1], ...
></code>
945 (where
<code>Sequence[
<emphasis>i
</emphasis>]
</code> denotes the
946 <emphasis>i
</emphasis>-th element of
<code>Sequence
</code>), except
947 that no upper limit is imposed on the number of types.
</simpara>
949 <simpara><emphasis role=
"bold">Notes
</emphasis>:
</simpara>
951 <listitem><code>Sequence
</code> must meet the requirements of
952 <libraryname>MPL
</libraryname>'s
<emphasis>Sequence
</emphasis>
954 <listitem>Due to standard conformance problems in several compilers,
955 <code>make_variant_over
</code> may not be supported on your
957 <code><macroname>BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
</macroname></code>
958 for more information.
</listitem>