<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Reference</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../variant.html" title="Chapter 27. Boost.Variant"> <link rel="prev" href="tutorial.html" title="Tutorial"> <link rel="next" href="../BOOST_VARIANT_LIMIT_TYPES.html" title="Macro BOOST_VARIANT_LIMIT_TYPES"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> <td align="center"><a href="../../../index.html">Home</a></td> <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="tutorial.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../variant.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../BOOST_VARIANT_LIMIT_TYPES.html"><img src="../../../doc/html/images/next.png" alt="Next"></a> </div> <div class="section" title="Reference"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="variant.reference"></a>Reference</h2></div></div></div> <div class="toc"><dl> <dt><span class="section"><a href="reference.html#variant.concepts">Concepts</a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant_hpp">Header <boost/variant.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.variant_fwd_hpp">Header <boost/variant/variant_fwd.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.variant_hpp">Header <boost/variant/variant.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.recursive_variant_hpp">Header <boost/variant/recursive_variant.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.recursive_wrapper_hpp">Header <boost/variant/recursive_wrapper.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.apply_visitor_hpp">Header <boost/variant/apply_visitor.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.get_hpp">Header <boost/variant/get.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.bad_visit_hpp">Header <boost/variant/bad_visit.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.static_visitor_hpp">Header <boost/variant/static_visitor.hpp></a></span></dt> <dt><span class="section"><a href="reference.html#header.boost.variant.visitor_ptr_hpp">Header <boost/variant/visitor_ptr.hpp></a></span></dt> </dl></div> <div class="section" title="Concepts"> <div class="titlepage"><div><div><h3 class="title"> <a name="variant.concepts"></a>Concepts</h3></div></div></div> <div class="toc"><dl> <dt><span class="section"><a href="reference.html#variant.concepts.bounded-type"><span class="emphasis"><em>BoundedType</em></span></a></span></dt> <dt><span class="section"><a href="reference.html#variant.concepts.static-visitor"><span class="emphasis"><em>StaticVisitor</em></span></a></span></dt> <dt><span class="section"><a href="reference.html#variant.concepts.output-streamable"><span class="emphasis"><em>OutputStreamable</em></span></a></span></dt> </dl></div> <div class="section" title="BoundedType"> <div class="titlepage"><div><div><h4 class="title"> <a name="variant.concepts.bounded-type"></a><span class="emphasis"><em>BoundedType</em></span> </h4></div></div></div> <p>The requirements on a <span class="bold"><strong>bounded type</strong></span> are as follows:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"> <a class="link" href="../CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a> [20.1.3].</li> <li class="listitem">Destructor upholds the no-throw exception-safety guarantee.</li> <li class="listitem">Complete at the point of <code class="computeroutput">variant</code> template instantiation. (See <code class="computeroutput"><a class="link" href="../boost/recursive_wrapper.html" title="Class template recursive_wrapper">boost::recursive_wrapper</a><T></code> for a type wrapper that accepts incomplete types to enable recursive <code class="computeroutput">variant</code> types.)</li> </ul></div> <p>Every type specified as a template argument to <code class="computeroutput"><a class="link" href="../boost/variant.html" title="Class template variant">variant</a></code> must at minimum fulfill the above requirements. In addition, certain features of <code class="computeroutput">variant</code> are available only if its bounded types meet the requirements of these following additional concepts:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"> <a class="link" href="../Assignable.html" title="Concept Assignable">Assignable</a>: <code class="computeroutput">variant</code> is itself <span class="emphasis"><em>Assignable</em></span> if and only if every one of its bounded types meets the requirements of the concept. (Note that top-level <code class="computeroutput">const</code>-qualified types and reference types do <span class="emphasis"><em>not</em></span> meet these requirements.)</li> <li class="listitem"> <a class="link" href="../DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a> [20.1.4]: <code class="computeroutput">variant</code> is itself <a class="link" href="../DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a> if and only if its first bounded type (i.e., <code class="computeroutput">T1</code>) meets the requirements of the concept.</li> <li class="listitem"> <a class="link" href="../EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a>: <code class="computeroutput">variant</code> is itself <a class="link" href="../EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a> if and only if every one of its bounded types meets the requirements of the concept.</li> <li class="listitem"> <a class="link" href="../LessThanComparable.html" title="Concept LessThanComparable">LessThanComparable</a>: <code class="computeroutput">variant</code> is itself <a class="link" href="../LessThanComparable.html" title="Concept LessThanComparable">LessThanComparable</a> if and only if every one of its bounded types meets the requirements of the concept.</li> <li class="listitem"> <a class="link" href="reference.html#variant.concepts.output-streamable" title="OutputStreamable"><span class="emphasis"><em>OutputStreamable</em></span></a>: <code class="computeroutput">variant</code> is itself <span class="emphasis"><em>OutputStreamable</em></span> if and only if every one of its bounded types meets the requirements of the concept.</li> </ul></div> </div> <div class="section" title="StaticVisitor"> <div class="titlepage"><div><div><h4 class="title"> <a name="variant.concepts.static-visitor"></a><span class="emphasis"><em>StaticVisitor</em></span> </h4></div></div></div> <div class="toc"><dl><dt><span class="section"><a href="reference.html#variant.concepts.static-visitor.examples">Examples</a></span></dt></dl></div> <p>The requirements on a <span class="bold"><strong>static visitor</strong></span> of a type <code class="computeroutput">T</code> are as follows:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem">Must allow invocation as a function by overloading <code class="computeroutput">operator()</code>, unambiguously accepting any value of type <code class="computeroutput">T</code>.</li> <li class="listitem">Must expose inner type <code class="computeroutput">result_type</code>. (See <code class="computeroutput"><a class="link" href="../boost/visitor_ptr.html" title="Function template visitor_ptr">boost::visitor_ptr</a></code> for a solution to using functions as visitors.)</li> <li class="listitem">If <code class="computeroutput">result_type</code> is not <code class="computeroutput">void</code>, then each operation of the function object must return a value implicitly convertible to <code class="computeroutput">result_type</code>.</li> </ul></div> <div class="section" title="Examples"> <div class="titlepage"><div><div><h5 class="title"> <a name="variant.concepts.static-visitor.examples"></a>Examples</h5></div></div></div> <p>The following class satisfies the requirements of a static visitor of several types (i.e., explicitly: <code class="computeroutput">int</code> and <code class="computeroutput">std::string</code>; or, e.g., implicitly: <code class="computeroutput">short</code> and <code class="computeroutput">const char *</code>; etc.):</p> <pre class="programlisting">class my_visitor : public <code class="computeroutput"><a class="link" href="../boost/static_visitor.html" title="Class template static_visitor">boost::static_visitor</a></code><int> { public: int operator()(int i) { return i * 2; } int operator()(const std::string& s) { return s.length(); } };</pre> <p>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., <code class="computeroutput">int</code>, <code class="computeroutput">double</code>, <code class="computeroutput">std::string</code>, etc.):</p> <pre class="programlisting">class printer : public <code class="computeroutput"><a class="link" href="../boost/static_visitor.html" title="Class template static_visitor">boost::static_visitor</a></code><> { template <typename T> void operator()(const T& t) { std::cout << t << std::endl; } };</pre> </div> </div> <div class="section" title="OutputStreamable"> <div class="titlepage"><div><div><h4 class="title"> <a name="variant.concepts.output-streamable"></a><span class="emphasis"><em>OutputStreamable</em></span> </h4></div></div></div> <p>The requirements on an <span class="bold"><strong>output streamable</strong></span> type <code class="computeroutput">T</code> are as follows:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">For any object <code class="computeroutput">t</code> of type <code class="computeroutput">T</code>, <code class="computeroutput">std::cout << t</code> must be a valid expression.</li></ul></div> </div> </div> <div class="section" title="Header <boost/variant.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant_hpp"></a>Header <<a href="../../../boost/variant.hpp" target="_top">boost/variant.hpp</a>></h3></div></div></div> <div class="toc"><dl><dt><span class="section"><a href="reference.html#variant.header.include-all"></a></span></dt></dl></div> <div class="section"> <div class="titlepage"></div> <p>This header exists simply as a convenience to the user, including all of the headers in the <code class="computeroutput">boost/variant</code> directory.</p> </div> </div> <div class="section" title="Header <boost/variant/variant_fwd.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.variant_fwd_hpp"></a>Header <<a href="../../../boost/variant/variant_fwd.hpp" target="_top">boost/variant/variant_fwd.hpp</a>></h3></div></div></div> <p>Provides forward declarations of the <code class="computeroutput"><a class="link" href="../boost/variant.html" title="Class template variant">boost::variant</a></code>, <code class="computeroutput"><a class="link" href="../boost/make_variant_over.html" title="Class template make_variant_over">boost::make_variant_over</a></code>, <code class="computeroutput"><a class="link" href="../boost/make_recursive_variant.html" title="Class template make_recursive_variant">boost::make_recursive_variant</a></code>, and <code class="computeroutput"><a class="link" href="../boost/make_recursive_variant__id1322832.html" title="Class template make_recursive_variant_over">boost::make_recursive_variant_over</a></code> class templates and the <code class="computeroutput">boost::recursive_variant_</code> tag type. Also defines several preprocessor symbols, as described below.</p> <pre class="synopsis"> <a class="link" href="../BOOST_VARIANT_LIMIT_TYPES.html" title="Macro BOOST_VARIANT_LIMIT_TYPES">BOOST_VARIANT_LIMIT_TYPES</a> <a class="link" href="../BOOST_VARIANT_ENUM_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_PARAMS">BOOST_VARIANT_ENUM_PARAMS</a>(param) <a class="link" href="../BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS">BOOST_VARIANT_ENUM_SHIFTED_PARAMS</a>(param) <a class="link" href="../BOOST_VARIANT_NO_REFERENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT">BOOST_VARIANT_NO_REFERENCE_SUPPORT</a> <a class="link" href="../BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT">BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT</a> <a class="link" href="../BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html" title="Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT">BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT</a></pre> </div> <div class="section" title="Header <boost/variant/variant.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.variant_hpp"></a>Header <<a href="../../../boost/variant/variant.hpp" target="_top">boost/variant/variant.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2 = <span class="emphasis"><em>unspecified</em></span>, ..., <span class="bold"><strong>typename</strong></span> TN = <span class="emphasis"><em>unspecified</em></span>> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/variant.html" title="Class template variant">variant</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Sequence> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/make_variant_over.html" title="Class template make_variant_over">make_variant_over</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type"><span class="bold"><strong>void</strong></span></span> <a class="link" href="../boost/swap_id1342802.html" title="Function template swap">swap</a>(<a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> &, <a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> ElemType, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type">std::basic_ostream<ElemType,Traits> &</span> <a class="link" href="../boost/operator_id1342875.html" title="Function template operator<<"><span class="bold"><strong>operator</strong></span><<</a>(std::basic_ostream<ElemType,Traits> &, <span class="bold"><strong>const</strong></span> <a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> &); }</pre> </div> <div class="section" title="Header <boost/variant/recursive_variant.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.recursive_variant_hpp"></a>Header <<a href="../../../boost/variant/recursive_variant.hpp" target="_top">boost/variant/recursive_variant.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.recursive_variant_"></a>recursive_variant_; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2 = <span class="emphasis"><em>unspecified</em></span>, ..., <span class="bold"><strong>typename</strong></span> TN = <span class="emphasis"><em>unspecified</em></span>> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/make_recursive_variant.html" title="Class template make_recursive_variant">make_recursive_variant</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Sequence> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/make_recursive_variant__id1322832.html" title="Class template make_recursive_variant_over">make_recursive_variant_over</a>; }</pre> </div> <div class="section" title="Header <boost/variant/recursive_wrapper.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.recursive_wrapper_hpp"></a>Header <<a href="../../../boost/variant/recursive_wrapper.hpp" target="_top">boost/variant/recursive_wrapper.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/recursive_wrapper.html" title="Class template recursive_wrapper">recursive_wrapper</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/is_recursive_wrapper.html" title="Class template is_recursive_wrapper">is_recursive_wrapper</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/unwrap_recursive_wrapper.html" title="Class template unwrap_recursive_wrapper">unwrap_recursive_wrapper</a>; }</pre> </div> <div class="section" title="Header <boost/variant/apply_visitor.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.apply_visitor_hpp"></a>Header <<a href="../../../boost/variant/apply_visitor.hpp" target="_top">boost/variant/apply_visitor.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Visitor> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/apply_visitor_delayed_t.html" title="Class template apply_visitor_delayed_t">apply_visitor_delayed_t</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Visitor, <span class="bold"><strong>typename</strong></span> Variant> <span class="type"><span class="bold"><strong>typename</strong></span> Visitor::result_type</span> <a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a>(Visitor &, Variant &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Visitor, <span class="bold"><strong>typename</strong></span> Variant> <span class="type"><span class="bold"><strong>typename</strong></span> Visitor::result_type</span> <a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a>(<span class="bold"><strong>const</strong></span> Visitor &, Variant &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> BinaryVisitor, <span class="bold"><strong>typename</strong></span> Variant1, <span class="bold"><strong>typename</strong></span> Variant2> <span class="type"><span class="bold"><strong>typename</strong></span> BinaryVisitor::result_type</span> <a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a>(BinaryVisitor &, Variant1 &, Variant2 &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> BinaryVisitor, <span class="bold"><strong>typename</strong></span> Variant1, <span class="bold"><strong>typename</strong></span> Variant2> <span class="type"><span class="bold"><strong>typename</strong></span> BinaryVisitor::result_type</span> <a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a>(<span class="bold"><strong>const</strong></span> BinaryVisitor &, Variant1 &, Variant2 &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Visitor> <span class="type"><a class="link" href="../boost/apply_visitor_delayed_t.html" title="Class template apply_visitor_delayed_t">apply_visitor_delayed_t</a><Visitor></span> <a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a>(Visitor &); }</pre> </div> <div class="section" title="Header <boost/variant/get.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.get_hpp"></a>Header <<a href="../../../boost/variant/get.hpp" target="_top">boost/variant/get.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/bad_get.html" title="Class bad_get">bad_get</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U, <span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type">U *</span> <a class="link" href="../boost/get_id1317854.html" title="Function get">get</a>(<a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> *); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U, <span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type"><span class="bold"><strong>const</strong></span> U *</span> <a class="link" href="../boost/get_id1317854.html" title="Function get">get</a>(<span class="bold"><strong>const</strong></span> <a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> *); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U, <span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type">U &</span> <a class="link" href="../boost/get_id1317854.html" title="Function get">get</a>(<a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> &); <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U, <span class="bold"><strong>typename</strong></span> T1, <span class="bold"><strong>typename</strong></span> T2, ..., <span class="bold"><strong>typename</strong></span> TN> <span class="type"><span class="bold"><strong>const</strong></span> U &</span> <a class="link" href="../boost/get_id1317854.html" title="Function get">get</a>(<span class="bold"><strong>const</strong></span> <a class="link" href="../boost/variant.html" title="Class template variant">variant</a><T1, T2, ..., TN> &); }</pre> </div> <div class="section" title="Header <boost/variant/bad_visit.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.bad_visit_hpp"></a>Header <<a href="../../../boost/variant/bad_visit.hpp" target="_top">boost/variant/bad_visit.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/bad_visit.html" title="Class bad_visit">bad_visit</a>; }</pre> </div> <div class="section" title="Header <boost/variant/static_visitor.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.static_visitor_hpp"></a>Header <<a href="../../../boost/variant/static_visitor.hpp" target="_top">boost/variant/static_visitor.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> ResultType> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/static_visitor.html" title="Class template static_visitor">static_visitor</a>; }</pre> </div> <div class="section" title="Header <boost/variant/visitor_ptr.hpp>"> <div class="titlepage"><div><div><h3 class="title"> <a name="header.boost.variant.visitor_ptr_hpp"></a>Header <<a href="../../../boost/variant/visitor_ptr.hpp" target="_top">boost/variant/visitor_ptr.hpp</a>></h3></div></div></div> <pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost { <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> R> <span class="bold"><strong>class</strong></span> <a class="link" href="../boost/visitor_ptr_t.html" title="Class template visitor_ptr_t">visitor_ptr_t</a>; <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> R, <span class="bold"><strong>typename</strong></span> T> <span class="type"><a class="link" href="../boost/visitor_ptr_t.html" title="Class template visitor_ptr_t">visitor_ptr_t</a><T,R></span> <a class="link" href="../boost/visitor_ptr.html" title="Function template visitor_ptr">visitor_ptr</a>(R (*)(T)); }</pre> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2002, 2003 Eric Friedman, Itay Maman<p>Distributed under the Boost Software License, Version 1.0. (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="tutorial.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../variant.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../BOOST_VARIANT_LIMIT_TYPES.html"><img src="../../../doc/html/images/next.png" alt="Next"></a> </div> </body> </html>