]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
4 | <head> | |
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
6 | <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" /> | |
7 | <title>The MPL Reference Manual: quote</title> | |
8 | <link rel="stylesheet" href="../style.css" type="text/css" /> | |
9 | </head> | |
10 | <body class="docframe refmanual"> | |
11 | <table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./bind.html" class="navigation-link">Prev</a> <a href="./arg.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./bind.html" class="navigation-link">Back</a> <a href="./arg.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./composition-and-argument-binding.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> | |
12 | <td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./metafunctions.html" class="navigation-link">Metafunctions</a> / <a href="./composition-and-argument-binding.html" class="navigation-link">Composition and Argument Binding</a> / <a href="./quote.html" class="navigation-link">quote</a></td> | |
13 | </tr></table><div class="header-separator"></div> | |
14 | <div class="section" id="quote"> | |
15 | <h1><a class="toc-backref" href="./composition-and-argument-binding.html#id1532">quote</a></h1> | |
16 | <div class="section" id="id938"> | |
17 | <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3> | |
18 | <pre class="literal-block"> | |
19 | template< | |
20 | template< typename P1 > class F | |
21 | , typename Tag = <em>unspecified</em> | |
22 | > | |
23 | struct quote1 | |
24 | { | |
25 | // <em>unspecified</em> | |
26 | // <em>...</em> | |
27 | }; | |
28 | ||
29 | <em>...</em> | |
30 | ||
31 | template< | |
32 | template< typename P1,<em>...</em> typename P<em>n</em> > class F | |
33 | , typename Tag = <em>unspecified</em> | |
34 | > | |
35 | struct <a href="./quote.html" class="identifier">quote</a><em>n</em> | |
36 | { | |
37 | // <em>unspecified</em> | |
38 | // <em>...</em> | |
39 | }; | |
40 | </pre> | |
41 | </div> | |
42 | <div class="section" id="id939"> | |
43 | <h3><a class="subsection-title" href="#description" name="description">Description</a></h3> | |
44 | <p><tt class="literal"><span class="pre"><a href="./quote.html" class="identifier">quote</a></span></tt><em>n</em> is a higher-order primitive that wraps an <em>n</em>-ary <a class="reference internal" href="./metafunction.html">Metafunction</a> to create | |
45 | a corresponding <a class="reference internal" href="./metafunction-class.html">Metafunction Class</a>.</p> | |
46 | </div> | |
47 | <div class="section" id="id940"> | |
48 | <h3><a class="subsection-title" href="#header" name="header">Header</a></h3> | |
49 | <pre class="literal-block"> | |
50 | #include <<a href="../../../../boost/mpl/quote.hpp" class="header">boost/mpl/quote.hpp</a>> | |
51 | </pre> | |
52 | </div> | |
53 | <div class="section" id="id941"> | |
54 | <h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3> | |
55 | <p><a class="reference internal" href="./metafunction-class.html">Metafunction Class</a></p> | |
56 | </div> | |
57 | <div class="section" id="id942"> | |
58 | <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3> | |
59 | <table border="1" class="docutils table"> | |
60 | <colgroup> | |
61 | <col width="18%" /> | |
62 | <col width="27%" /> | |
63 | <col width="55%" /> | |
64 | </colgroup> | |
65 | <thead valign="bottom"> | |
66 | <tr><th class="head">Parameter</th> | |
67 | <th class="head">Requirement</th> | |
68 | <th class="head">Description</th> | |
69 | </tr> | |
70 | </thead> | |
71 | <tbody valign="top"> | |
72 | <tr><td><tt class="literal"><span class="pre">F</span></tt></td> | |
73 | <td><a class="reference internal" href="./metafunction.html">Metafunction</a></td> | |
74 | <td>A metafunction to wrap.</td> | |
75 | </tr> | |
76 | <tr><td><tt class="literal"><span class="pre">Tag</span></tt></td> | |
77 | <td>Any type</td> | |
78 | <td>A tag determining wrap semantics.</td> | |
79 | </tr> | |
80 | </tbody> | |
81 | </table> | |
82 | </div> | |
83 | <div class="section" id="id943"> | |
84 | <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3> | |
85 | <p>For any <em>n</em>-ary <a class="reference internal" href="./metafunction.html">Metafunction</a> <tt class="literal"><span class="pre">f</span></tt> and arbitrary type <tt class="literal"><span class="pre">tag</span></tt>:</p> | |
86 | <pre class="literal-block"> | |
87 | typedef <a href="./quote.html" class="identifier">quote</a><em>n</em><f> g; | |
88 | typedef <a href="./quote.html" class="identifier">quote</a><em>n</em><f,tag> g; | |
89 | </pre> | |
90 | <table class="docutils field-list" frame="void" rules="none"> | |
91 | <col class="field-name" /> | |
92 | <col class="field-body" /> | |
93 | <tbody valign="top"> | |
94 | <tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="./metafunction-class.html">Metafunction Class</a></p> | |
95 | </td> | |
96 | </tr> | |
97 | <tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p> | |
98 | <pre class="literal-block"> | |
99 | struct g | |
100 | { | |
101 | template< typename A1,<em>...</em> typename A<em>n</em> > struct <a href="./apply.html" class="identifier">apply</a> | |
102 | : f<A1,<em>...</em>A<em>n</em>> | |
103 | { | |
104 | }; | |
105 | }; | |
106 | </pre> | |
107 | <p>if <tt class="literal"><span class="pre">f<A1,...An></span></tt> has a nested type member <tt class="literal"><span class="pre">::type</span></tt>, and to</p> | |
108 | <pre class="literal-block"> | |
109 | struct g | |
110 | { | |
111 | template< typename A1,<em>...</em> typename A<em>n</em> > struct <a href="./apply.html" class="identifier">apply</a> | |
112 | { | |
113 | typedef f<A1,<em>...</em>A<em>n</em>> type; | |
114 | }; | |
115 | }; | |
116 | </pre> | |
117 | <p class="last">otherwise.</p> | |
118 | </td> | |
119 | </tr> | |
120 | </tbody> | |
121 | </table> | |
122 | </div> | |
123 | <div class="section" id="id944"> | |
124 | <h3><a class="subsection-title" href="#example" name="example">Example</a></h3> | |
125 | <pre class="literal-block"> | |
126 | template< typename T > struct f1 | |
127 | { | |
128 | typedef T type; | |
129 | }; | |
130 | ||
131 | template< | |
132 | typename T1, typename T2, typename T3, typename T4, typename T5 | |
133 | > | |
134 | struct f5 | |
135 | { | |
136 | // no 'type' member! | |
137 | }; | |
138 | ||
139 | typedef <a href="./quote.html" class="identifier">quote</a><tt class="literal"><span class="pre">1</span></tt><f1>::<a href="./apply.html" class="identifier">apply</a><int>::type t1; | |
140 | typedef <a href="./quote.html" class="identifier">quote</a><tt class="literal"><span class="pre">5</span></tt><f5>::<a href="./apply.html" class="identifier">apply</a><char,short,int,long,float>::type t5; | |
141 | ||
142 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< t1, int > )); | |
143 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< t5, f5<char,short,int,long,float> > )); | |
144 | </pre> | |
145 | </div> | |
146 | <div class="section" id="id945"> | |
147 | <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3> | |
148 | <p><a class="reference internal" href="./composition-and-argument-binding.html">Composition and Argument Binding</a>, <a class="reference internal" href="./invocation.html">invocation</a>, <a class="reference internal" href="./bind.html">bind</a>, <a class="reference internal" href="./lambda.html">lambda</a>, <a class="reference internal" href="./protect.html">protect</a>, <a class="reference internal" href="./apply.html">apply</a></p> | |
149 | <!-- Metafunctions/Composition and Argument Binding//arg |50 --> | |
150 | </div> | |
151 | </div> | |
152 | ||
153 | <div class="footer-separator"></div> | |
154 | <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./bind.html" class="navigation-link">Prev</a> <a href="./arg.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./bind.html" class="navigation-link">Back</a> <a href="./arg.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./composition-and-argument-binding.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> | |
155 | <td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</div> | |
156 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
157 | file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body> | |
158 | </html> |