mirror of
https://github.com/boostorg/variant.git
synced 2026-02-11 00:12:08 +00:00
57 lines
2.6 KiB
XML
57 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<header name="boost/variant/variant_fwd.hpp">
|
|
<section id="variant.header.variant_fwd">
|
|
<para>Provides a forward declaration of the
|
|
<code><classname>boost::variant</classname></code> class template. Also
|
|
defines the following preprocessor symbols:</para>
|
|
|
|
<section id="variant.macro.BOOST_VARIANT_LIMIT_TYPES">
|
|
<title>BOOST_VARIANT_LIMIT_TYPES</title>
|
|
|
|
<para>Preprocessor macro. Expands to the length of the template
|
|
parameter list for
|
|
<code><classname alt="boost::variant">variant</classname></code>.</para>
|
|
|
|
<para><emphasis role="bold">Note</emphasis>: Conforming implementations
|
|
of <code>variant</code> must allow at least ten bounded types. That is,
|
|
<code>BOOST_VARIANT_LIMIT_TYPES >= 10</code> must be
|
|
<code>true</code>.</para>
|
|
</section>
|
|
|
|
<section id="variant.macro.BOOST_VARIANT_ENUM_PARAMS">
|
|
<title>BOOST_VARIANT_ENUM_PARAMS(<emphasis>param</emphasis>)</title>
|
|
|
|
<para>Preprocessor macro. Expands to a comma-separated sequence of length
|
|
<code><link linkend="variant.macro.BOOST_VARIANT_LIMIT_TYPES">BOOST_VARIANT_LIMIT_TYPES</link></code>,
|
|
where each element in the sequence consists of the concatenation of
|
|
<emphasis>param</emphasis> with its zero-based index into the
|
|
sequence. That is, <code>param ## 0, param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1</code>.</para>
|
|
|
|
<para><emphasis role="bold">Rationale</emphasis>: This macro greatly
|
|
simplifies for the user the process of declaring
|
|
<code><classname alt="boost::variant">variant</classname></code> types
|
|
in function templates or explicit partial specializations of class
|
|
templates, as shown in the following examples:</para>
|
|
|
|
<programlisting>template <typename T> class some_class;
|
|
|
|
// example: <emphasis>explicit partial specialization</emphasis>
|
|
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
|
class some_class< boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >;
|
|
|
|
// example: <emphasis>function template</emphasis>
|
|
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
|
void f(const boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> &);</programlisting>
|
|
|
|
</section>
|
|
|
|
<section id="variant.macro.BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT">
|
|
<title>BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT</title>
|
|
|
|
<para>Configuration preprocessor symbol. Defined only if the
|
|
<code><classname>boost::variant</classname><
|
|
<emphasis>type-sequence</emphasis> ></code> syntax is not supported
|
|
for some reason on the current platform or compiler.</para>
|
|
</section>
|
|
</section>
|
|
</header> |