File: variant_fwd.xml

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (122 lines) | stat: -rw-r--r-- 5,604 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE header PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<!--
    Copyright 2003, Eric Friedman, Itay Maman.
    Copyright 2016-2025 Antony Polukhin.

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/variant/variant_fwd.hpp">
  <using-namespace name="boost"/>

  <para>Provides forward declarations of the
    <code><classname>boost::variant</classname></code>,
    <code><classname>boost::make_variant_over</classname></code>,
    <code><classname>boost::make_recursive_variant</classname></code>, and
    <code><classname>boost::make_recursive_variant_over</classname></code>
    class templates and the <code>boost::recursive_variant_</code> tag type.
    Also defines several preprocessor symbols, as described below.</para>

  <macro name="BOOST_VARIANT_ENUM_PARAMS" kind="functionlike">
    <macro-parameter name="param"/>

    <purpose>
      <simpara>Enumerate parameters for use with
        <code><classname>variant</classname></code>.</simpara>
    </purpose>

    <description>
      <para> Expands to variadic template list in the following manner:
        <code><programlisting>
            BOOST_VARIANT_ENUM_PARAMS(T)                    => T0, TN...
            BOOST_VARIANT_ENUM_PARAMS(class T)              => class T0, class... TN
            BOOST_VARIANT_ENUM_PARAMS(class Something)      => class Something0, class... SomethingN
            BOOST_VARIANT_ENUM_PARAMS(typename Something)   => typename Something0, typename... SomethingN
            BOOST_VARIANT_ENUM_PARAMS(Something)            => Something0, SomethingN...
            BOOST_VARIANT_ENUM_PARAMS(Something)            => Something0, SomethingN...
        </programlisting></code>
      </para>

      <para>
        Otherwise expands to a comma-separated sequence of length
        <code><macroname>BOOST_VARIANT_LIMIT_TYPES</macroname></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>variant</classname></code> types
        in function templates or explicit partial specializations of class
        templates, as shown in the
        <link linkend="variant.tutorial.preprocessor">tutorial</link>.</para>
    </description>
  </macro>

  <macro name="BOOST_VARIANT_ENUM_SHIFTED_PARAMS" kind="functionlike">
    <macro-parameter name="param"/>

    <purpose>
      <simpara>Enumerate all but the first parameter for use with
        <code><classname>variant</classname></code>.</simpara>
    </purpose>

    <description>
      <para> Expands to variadic template list in the following manner:
        <code><programlisting>
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T)                    => TN...
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class T)              => class... TN
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class Something)      => class... SomethingN
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename Something)   => typename... SomethingN
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something)            => SomethingN...
            BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something)            => SomethingN...
        </programlisting></code>
      </para>

      <para>
        Otherwise expands to a comma-separated sequence of length
        <code><macroname>BOOST_VARIANT_LIMIT_TYPES</macroname> - 1</code>,
        where each element in the sequence consists of the concatenation of
        <emphasis>param</emphasis> with its one-based index into the sequence.
        That is,
        <code>param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1</code>.</para>

      <para><emphasis role="bold">Note</emphasis>: This macro results in the
        same expansion as
        <code><macroname>BOOST_VARIANT_ENUM_PARAMS</macroname></code> -- but
        without the first term.</para>
    </description>
  </macro>

  <macro name="BOOST_VARIANT_DO_NOT_SPECIALIZE_STD_HASH">
    <purpose>
      <simpara>Define this macro if you do not wish to have a <code><classname>std::hash</classname></code> specialization for
      <code><classname>boost::variant</classname></code>.</simpara>
    </purpose>
  </macro>

  <macro name="BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT">
    <purpose>
      <simpara>Indicates
        <code><classname>make_recursive_variant</classname></code> operates in
        an implementation-defined manner.</simpara>
    </purpose>

    <description>
      <para>Defined only if
        <code><classname>make_recursive_variant</classname></code> does not
        operate as documented on the target compiler, but rather in an
        implementation-defined manner.</para>

      <para><emphasis role="bold">Implementation Note</emphasis>: If
        <code>BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT</code> is
        defined for the target compiler, the current implementation uses the
        <libraryname>MPL</libraryname> lambda mechanism to approximate the
        desired behavior. (In most cases, however, such compilers do not have
        full lambda support either.)</para>
    </description>
  </macro>
</header>