| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Miscellaneous Notes</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.61.3"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="variant.html" title="Boost.Variant"><link rel="previous" href="variant.design.html" title="Design Overview"><link rel="next" href="variant.refs.html" title="References"><link rel="chapter" href="libraries.html" title="The Boost C++ Libraries"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2383300-bb.html" title="Function any_cast"><link rel="chapter" href="array.html" title="Boost.Array"><link rel="refentry" href="class.boost.array.html" title="Class template array"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="class.boost.bad_function_call.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="class.boost.reference_wrapper.html" title="Class template reference_wrapper"><link rel="refentry" href="class.boost.is_reference_wrapper.html" title="Class template is_reference_wrapper"><link rel="refentry" href="class.boost.unwrap_reference.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="class.boost.signals.trackable.html" title="Class trackable"><link rel="refentry" href="class.boost.signals.connection.html" title="Class connection"><link rel="refentry" href="class.boost.signals.scoped_connection.html" title="Class scoped_connection"><link rel="refentry" href="id2532119-bb.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2354683-bb.html" title="Class last_value<void>"><link rel="chapter" href="variant.html" title="Boost.Variant"><link rel="refentry" href="BOOST_VARIANT_LIMIT_TYPES.html" title="Macro BOOST_VARIANT_LIMIT_TYPES"><link rel="refentry" href="BOOST_VARIANT_ENUM_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_PARAMS"><link rel="refentry" href="BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS"><link rel="refentry" href="BOOST_VARIANT_NO_REFERENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html" title="Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT"><link rel="refentry" href="class.boost.variant.html" title="Class template variant"><link rel="refentry" href="id2518553-bb.html" title="Function template swap"><link rel="refentry" href="id2524211-bb.html" title="Function template operator<<"><link rel="refentry" href="class.boost.make_variant_over.html" title="Class template make_variant_over"><link rel="refentry" href="class.boost.make_recursive_variant.html" title="Class template make_recursive_variant"><link rel="refentry" href="class.boost.make_recursive_variant_over.html" title="Class template make_recursive_variant_over"><link rel="refentry" href="class.boost.recursive_wrapper.html" title="Class template recursive_wrapper"><link rel="refentry" href="class.boost.is_recursive_wrapper.html" title="Class template is_recursive_wrapper"><link rel="refentry" href="class.boost.unwrap_recursive_wrapper.html" title="Class template unwrap_recursive_wrapper"><link rel="refentry" href="class.boost.apply_visitor_delayed_t.html" title="Class template apply_visitor_delayed_t"><link rel="refentry" href="id2557051-bb.html" title="Function apply_visitor"><link rel="refentry" href="class.boost.bad_get.html" title="Class bad_get"><link rel="refentry" href="id2493238-bb.html" title="Function get"><link rel="refentry" href="class.boost.bad_visit.html" title="Class bad_visit"><link rel="refentry" href="class.boost.static_visitor.html" title="Class template static_visitor"><link rel="refentry" href="class.boost.visitor_ptr_t.html" title="Class template visitor_ptr_t"><link rel="refentry" href="id2544445-bb.html" title="Function template visitor_ptr"><link rel="chapter" href="boostbook.html" title="The BoostBook Documentation Format"><link rel="refentry" href="boostbook.dtd.class-specialization.html" title="
- BoostBook element class-specialization"><link rel="refentry" href="boostbook.dtd.link-test.html" title="
- BoostBook element link-test"><link rel="refentry" href="boostbook.dtd.link-fail-test.html" title="
- BoostBook element link-fail-test"><link rel="refentry" href="boostbook.dtd.typedef.html" title="
- BoostBook element typedef"><link rel="refentry" href="boostbook.dtd.static-constant.html" title="
- BoostBook element static-constant"><link rel="refentry" href="boostbook.dtd.code.html" title="
- BoostBook element code"><link rel="refentry" href="boostbook.dtd.destructor.html" title="
- BoostBook element destructor"><link rel="refentry" href="boostbook.dtd.template-type-parameter.html" title="
- BoostBook element template-type-parameter"><link rel="refentry" href="boostbook.dtd.description.html" title="
- BoostBook element description"><link rel="refentry" href="boostbook.dtd.librarylist.html" title="
- BoostBook element librarylist"><link rel="refentry" href="boostbook.dtd.library-reference.html" title="
- BoostBook element library-reference"><link rel="refentry" href="boostbook.dtd.boostbook.html" title="
- BoostBook element boostbook"><link rel="refentry" href="boostbook.dtd.union.html" title="
- BoostBook element union"><link rel="refentry" href="boostbook.dtd.inherit.html" title="
- BoostBook element inherit"><link rel="refentry" href="boostbook.dtd.template-varargs.html" title="
- BoostBook element template-varargs"><link rel="refentry" href="boostbook.dtd.source.html" title="
- BoostBook element source"><link rel="refentry" href="boostbook.dtd.function.html" title="
- BoostBook element function"><link rel="refentry" href="boostbook.dtd.postconditions.html" title="
- BoostBook element postconditions"><link rel="refentry" href="boostbook.dtd.compile-test.html" title="
- BoostBook element compile-test"><link rel="refentry" href="boostbook.dtd.method.html" title="
- BoostBook element method"><link rel="refentry" href="boostbook.dtd.snippet.html" title="
- BoostBook element snippet"><link rel="refentry" href="boostbook.dtd.constructor.html" title="
- BoostBook element constructor"><link rel="refentry" href="boostbook.dtd.namespace.html" title="
- BoostBook element namespace"><link rel="refentry" href="boostbook.dtd.if-fails.html" title="
- BoostBook element if-fails"><link rel="refentry" href="boostbook.dtd.free-function-group.html" title="
- BoostBook element free-function-group"><link rel="refentry" href="boostbook.dtd.functionname.html" title="
- BoostBook element functionname"><link rel="refentry" href="boostbook.dtd.librarycategory.html" title="
- BoostBook element librarycategory"><link rel="refentry" href="boostbook.dtd.notes.html" title="
- BoostBook element notes"><link rel="refentry" href="boostbook.dtd.data-member.html" title="
- BoostBook element data-member"><link rel="refentry" href="boostbook.dtd.specialization.html" title="
- BoostBook element specialization"><link rel="refentry" href="boostbook.dtd.union-specialization.html" title="
- BoostBook element union-specialization"><link rel="refentry" href="boostbook.dtd.throws.html" title="
- BoostBook element throws"><link rel="refentry" href="boostbook.dtd.template-arg.html" title="
- BoostBook element template-arg"><link rel="refentry" href="boostbook.dtd.method-group.html" title="
- BoostBook element method-group"><link rel="refentry" href="boostbook.dtd.requirement.html" title="
- BoostBook element requirement"><link rel="refentry" href="boostbook.dtd.precondition.html" title="
- BoostBook element precondition"><link rel="refentry" href="boostbook.dtd.paramtype.html" title="
- BoostBook element paramtype"><link rel="refentry" href="boostbook.dtd.using-class.html" title="
- BoostBook element using-class"><link rel="refentry" href="boostbook.dtd.run-test.html" title="
- BoostBook element run-test"><link rel="refentry" href="boostbook.dtd.librarypurpose.html" title="
- BoostBook element librarypurpose"><link rel="refentry" href="boostbook.dtd.copy-assignment.html" title="
- BoostBook element copy-assignment"><link rel="refentry" href="boostbook.dtd.run-fail-test.html" title="
- BoostBook element run-fail-test"><link rel="refentry" href="boostbook.dtd.template.html" title="
- BoostBook element template"><link rel="refentry" href="boostbook.dtd.compile-fail-test.html" title="
- BoostBook element compile-fail-test"><link rel="refentry" href="boostbook.dtd.returns.html" title="
- BoostBook element returns"><link rel="refentry" href="boostbook.dtd.default.html" title="
- BoostBook element default"><link rel="refentry" href="boostbook.dtd.parameter.html" title="
- BoostBook element parameter"><link rel="refentry" href="boostbook.dtd.signature.html" title="
- BoostBook element signature"><link rel="refentry" href="boostbook.dtd.overloaded-function.html" title="
- BoostBook element overloaded-function"><link rel="refentry" href="boostbook.dtd.class.html" title="
- BoostBook element class"><link rel="refentry" href="boostbook.dtd.librarycategorydef.html" title="
- BoostBook element librarycategorydef"><link rel="refentry" href="boostbook.dtd.type.html" title="
- BoostBook element type"><link rel="refentry" href="boostbook.dtd.enumvalue.html" title="
- BoostBook element enumvalue"><link rel="refentry" href="boostbook.dtd.overloaded-method.html" title="
- BoostBook element overloaded-method"><link rel="refentry" href="boostbook.dtd.programlisting.html" title="
- BoostBook element programlisting"><link rel="refentry" href="boostbook.dtd.complexity.html" title="
- BoostBook element complexity"><link rel="refentry" href="boostbook.dtd.purpose.html" title="
- BoostBook element purpose"><link rel="refentry" href="boostbook.dtd.template-nontype-parameter.html" title="
- BoostBook element template-nontype-parameter"><link rel="refentry" href="boostbook.dtd.library.html" title="
- BoostBook element library"><link rel="refentry" href="boostbook.dtd.librarycategorylist.html" title="
- BoostBook element librarycategorylist"><link rel="refentry" href="boostbook.dtd.using-namespace.html" title="
- BoostBook element using-namespace"><link rel="refentry" href="boostbook.dtd.struct-specialization.html" title="
- BoostBook element struct-specialization"><link rel="refentry" href="boostbook.dtd.struct.html" title="
- BoostBook element struct"><link rel="refentry" href="boostbook.dtd.lib.html" title="
- BoostBook element lib"><link rel="refentry" href="boostbook.dtd.enum.html" title="
- BoostBook element enum"><link rel="refentry" href="boostbook.dtd.requires.html" title="
- BoostBook element requires"><link rel="refentry" href="boostbook.dtd.effects.html" title="
- BoostBook element effects"><link rel="refentry" href="boostbook.dtd.libraryname.html" title="
- BoostBook element libraryname"><link rel="refentry" href="boostbook.dtd.libraryinfo.html" title="
- BoostBook element libraryinfo"><link rel="refentry" href="boostbook.dtd.testsuite.html" title="
- BoostBook element testsuite"><link rel="refentry" href="boostbook.dtd.header.html" title="
- BoostBook element header"><link rel="refentry" href="boostbook.dtd.rationale.html" title="
- BoostBook element rationale"><link rel="refentry" href="Assignable.html" title="Concept Assignable"><link rel="refentry" href="InputIterator.html" title="Concept InputIterator"><link rel="refentry" href="OutputIterator.html" title="Concept OutputIterator"><link rel="refentry" href="ForwardIterator.html" title="Concept ForwardIterator"><link rel="refentry" href="BidirectionalIterator.html" title="Concept BidirectionalIterator"><link rel="refentry" href="RandomAccessIterator.html" title="Concept RandomAccessIterator"><link rel="refentry" href="DefaultConstructible.html" title="Concept DefaultConstructible"><link rel="refentry" href="CopyConstructible.html" title="Concept CopyConstructible"><link rel="refentry" href="EqualityComparable.html" title="Concept EqualityComparable"><link rel="refentry" href="LessThanComparable.html" title="Concept LessThanComparable"><link rel="refentry" href="SignedInteger.html" title="Concept SignedInteger"><link rel="subsection" href="variant.misc.html#variant.versus-any" title="Boost.Variant vs. Boost.Any"><link rel="subsection" href="variant.misc.html#id2539312" title="Portability"><link rel="subsection" href="variant.misc.html#variant.troubleshooting" title="Troubleshooting"><link rel="subsection" href="variant.misc.html#variant.ack" title="Acknowledgments"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="libraries.html"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="variant.misc"></a>Miscellaneous Notes</h3></div></div><div></div></div><div class="toc"><dl><dt><a href="variant.misc.html#variant.versus-any">Boost.Variant vs. Boost.Any</a></dt><dt><a href="variant.misc.html#id2539312">Portability</a></dt><dt><a href="variant.misc.html#variant.troubleshooting">Troubleshooting</a></dt><dt><a href="variant.misc.html#variant.ack">Acknowledgments</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="variant.versus-any"></a>Boost.Variant vs. Boost.Any</h4></div></div><div></div></div><p>As a discriminated union container, the Variant library shares many
- of the same features of the <a href="any.html" title="Boost.Any">Any</a> library.
- However, since neither library wholly encapsulates the features of the
- other, one library cannot be generally recommended for use over the
- other.</p><p>That said, Boost.Variant has several advantages over Boost.Any,
- such as:
- </p><div class="itemizedlist"><ul type="disc"><li>Boost.Variant guarantees the type of its content is one of a
- finite, user-specified set of types.</li><li>Boost.Variant provides <span class="emphasis"><em>compile-time</em></span>
- checked visitation of its content. (By contrast, the current version
- of Boost.Any provides no visitation mechanism at all; but even if it
- did, it would need to be checked at run-time.)</li><li>Boost.Variant enables generic visitation of its content.
- (Even if Boost.Any did provide a visitation mechanism, it would enable
- visitation only of explicitly-specified types.)</li><li>Boost.Variant offers an efficient, stack-based storage scheme
- (avoiding the overhead of dynamic allocation).</li></ul></div><p>Of course, Boost.Any has several advantages over Boost.Variant,
- such as:
- </p><div class="itemizedlist"><ul type="disc"><li>Boost.Any, as its name implies, allows virtually any type for
- its content, providing great flexibility.</li><li>Boost.Any provides the no-throw guarantee of exception safety
- for its swap operation.</li><li>Boost.Any makes little use of template metaprogramming
- techniques (avoiding potentially hard-to-read error messages and
- significant compile-time processor and memory demands).</li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2539312"></a>Portability</h4></div></div><div></div></div><p>The library aims for 100% ANSI/ISO C++ conformance. However, this is
- strictly impossible due to the inherently non-portable nature of the
- <a href="../../libs/type_traits/index.htm" target="_top">Type Traits</a> library's
- <tt class="computeroutput">type_with_alignment</tt> facility. In
- practice though, no compilers or platforms have been discovered where this
- reliance on undefined behavior has been an issue.</p><p>Additionally, significant effort has been expended to ensure proper
- functioning despite various compiler bugs and other conformance problems.
- To date the library <a href="">testsuite</a> has
- been compiled and tested successfully on at least the following compilers
- for basic and advanced functionality:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col><col></colgroup><thead><tr><th> </th><th>Basic</th><th><tt class="computeroutput">variant<T&></tt></th><th><a href="variant.tutorial.html#variant.tutorial.over-sequence" title="Using a type sequence to specify bounded types"><tt class="computeroutput">make_variant_over</tt></a></th><th><a href="variant.tutorial.html#variant.tutorial.recursive.recursive-variant" title="Recursive types with make_recursive_variant"><tt class="computeroutput">make_recursive_variant</tt></a></th></tr></thead><tbody><tr><td>Borland C++ 5.5.1 and 5.6.4</td><td>X</td><td>X</td><td> </td><td> </td></tr><tr><td>Comeau C++ 4.3.0</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>GNU GCC 3.3.1</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>GNU GCC 2.95.3</td><td>X</td><td>X</td><td> </td><td>X</td></tr><tr><td>Intel C++ 7.0</td><td>X</td><td> </td><td>X</td><td>X</td></tr><tr><td>Metrowerks CodeWarrior 8.3</td><td>X</td><td> </td><td>X</td><td>X</td></tr><tr><td>Microsoft Visual C++ 7.1</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Microsoft Visual C++ 6 SP5 and 7</td><td>X</td><td> </td><td> </td><td> </td></tr></tbody></table></div><p>Finally, the current state of the testsuite in CVS may be found on the
- <a href="http://boost.sourceforge.net/regression-logs" target="_top">Test Summary</a>
- page. Please note, however, that this page reports on day-to-day changes
- to inter-release code found in the Boost CVS and thus likely does not
- match the state of code found in Boost releases.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="variant.troubleshooting"></a>Troubleshooting</h4></div></div><div></div></div><div class="toc"><dl><dt><a href="variant.misc.html#variant.troubleshooting.template-depth">"Template instantiation depth exceeds maximum"</a></dt><dt><a href="variant.misc.html#variant.troubleshooting.compiler-memory">"Internal heap limit reached"</a></dt></dl></div><p>Due to the heavy use of templates in the implementation of
- <tt class="computeroutput">variant</tt>, it is not uncommon when compiling to encounter
- problems related to template instantiaton depth, compiler memory, etc. This
- section attempts to provide advice to common problems experienced on several
- popular compilers.</p><p>(This section is still in progress, with additional advice/feedback
- welcome. Please post to the Boost-Users list with any useful experiences you
- may have.)</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="variant.troubleshooting.template-depth"></a>"Template instantiation depth exceeds maximum"</h5></div></div><div></div></div><div class="toc"><dl><dt><a href="variant.misc.html#variant.troubleshooting.template-depth.gcc">GNU GCC</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="variant.troubleshooting.template-depth.gcc"></a>GNU GCC</h6></div></div><div></div></div><p>The compiler option
- <tt class="computeroutput">-ftemplate-depth-<span class="emphasis"><em>NN</em></span></tt> can increase the
- maximum allowed instantiation depth. (Try
- <tt class="computeroutput">-ftemplate-depth-50</tt>.)</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="variant.troubleshooting.compiler-memory"></a>"Internal heap limit reached"</h5></div></div><div></div></div><div class="toc"><dl><dt><a href="variant.misc.html#variant.troubleshooting.compiler-memory.msvc">Microsoft Visual C++</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="variant.troubleshooting.compiler-memory.msvc"></a>Microsoft Visual C++</h6></div></div><div></div></div><p>The compiler option <tt class="computeroutput">/Zm<span class="emphasis"><em>NNN</em></span></tt> can
- increase the memory allocation limit. The <tt class="computeroutput">NNN</tt> is a
- scaling percentage (i.e., <tt class="computeroutput">100</tt> denotes the default limit).
- (Try <tt class="computeroutput">/Zm200</tt>.)</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="variant.ack"></a>Acknowledgments</h4></div></div><div></div></div><p>Eric Friedman and Itay Maman designed the initial submission; Eric was
- the primary implementer.</p><p>Eric is also the library maintainer and has expanded upon the initial
- submission -- adding
- <tt class="computeroutput"><a href="class.boost.make_recursive_variant.html" title="Class template make_recursive_variant">make_recursive_variant</a></tt>,
- <tt class="computeroutput"><a href="class.boost.make_variant_over.html" title="Class template make_variant_over">make_variant_over</a></tt>, support for
- reference content, etc.</p><p>Andrei Alexandrescu's work in
- [<a href="variant.refs.html#variant.refs.ale01a">Ale01a</a>]
- and
- [<a href="variant.refs.html#variant.refs.ale02">Ale02</a>]
- inspired the library's design.</p><p>Jeff Garland was the formal review manager.</p><p>Douglas Gregor,
- Dave Abrahams,
- Anthony Williams,
- Fernando Cacciola,
- Joel de Guzman,
- Dirk Schreib,
- Brad King,
- Giovanni Bajo,
- Eugene Gladyshev,
- and others provided helpful feedback and suggestions to refine the semantics,
- interface, and implementation of the library.</p></div></div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr><td align="left"><small>Last revised: , at GMT</small></td><td align="right"><small>Copyright © 2002, 2003 Eric Friedman, Itay Maman</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="variant.design.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="variant.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="variant.refs.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Design Overview </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> References</td></tr></table></div></body></html>
|