3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Macro Metafunctions</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../index.html" title="Chapter 1. The Type Traits Introspection Library">
8 <link rel="up" href="../index.html" title="Chapter 1. The Type Traits Introspection Library">
9 <link rel="prev" href="tti_functionality.html" title="General Functionality">
10 <link rel="next" href="tti_detail_has_type.html" title="Introspecting an inner type">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="tti_functionality.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tti_detail_has_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="the_type_traits_introspection_library.tti_detail"></a><a class="link" href="tti_detail.html" title="Macro Metafunctions">Macro
29 </h2></div></div></div>
31 The TTI library uses macros to create metafunctions, in the current scope,
32 for introspecting an inner element by name. Each macro for a particular type
33 of inner element has two forms, the simple one where the first macro parameter
34 designating the 'name' of the inner element is used to create the name of the
35 metafunction, and the complex one where the first macro parameter, called 'trait',
36 designates the name of the metafunction and the second macro parameter designates
37 the 'name' to be introspected. Other than that difference, the two forms of
38 the macro create metafunctions which have the exact same functionality.
41 To use these metafunctions you can include the main general header file 'boost/tti/tti.hpp',
42 unless otherwise noted. Alternatively you can include a specific header file
43 as given in the table below.
46 A table of these macros is given, based on the inner element whose existence
47 the metaprogrammer is introspecting. More detailed explanations and examples
48 for each of the macro metafunctions will follow this section in the documentation.
49 The actual syntax for each macro metafunction can be found in the reference
50 section, and examples of usage for all the macro metafunctions can be found
51 in the <a class="link" href="tti_usingMM.html#sectti_usingMM">"Using the Macro Metafunctions"</a>
55 In the Template column only the name generated by the simple form of the template
56 is given since the name generated by the complex form is always 'trait' where
57 'trait' is the first parameter to the corresponding complex form macro.
60 All of the introspecting metafunctions in the table below return a boolean
61 constant called 'value', which specifies whether or not the inner element exists.
62 All of the metafunctions also have a nested type called 'type', which for each
63 one is the type of the boolean constant value. This is always boost::mpl::bool_.
66 <a name="the_type_traits_introspection_library.tti_detail.tbmacros"></a><p class="title"><b>Table 1.2. TTI Macro Metafunctions</b></p>
67 <div class="table-contents"><table class="table" summary="TTI Macro Metafunctions">
105 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TYPE.html" title="Macro BOOST_TTI_HAS_TYPE">BOOST_TTI_HAS_TYPE</a></code>(name)
110 <code class="computeroutput"><span class="identifier">has_type_</span><span class="char">'name'</span></code>
113 class TTI_T = enclosing type
118 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_type_hpp.html" title="Header <boost/tti/has_type.hpp>">has_type.hpp</a></code>
125 Type with lambda expression
130 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TYPE.html" title="Macro BOOST_TTI_HAS_TYPE">BOOST_TTI_HAS_TYPE</a></code>(name)
135 <code class="computeroutput"><span class="identifier">has_type_</span><span class="char">'name'</span></code>
138 class TTI_T = enclosing type
141 class TTI_U = lambda expression invoked with the inner type and returning
147 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_type_hpp.html" title="Header <boost/tti/has_type.hpp>">has_type.hpp</a></code>
154 Class Template ( using variadic macros )
159 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TEMPLATE.html" title="Macro BOOST_TTI_HAS_TEMPLATE">BOOST_TTI_HAS_TEMPLATE</a></code>(name)
164 <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code>
167 class TTI_T = enclosing type
170 All of the template parameters must be template type parameters (
171 'class' or 'typename' parameters )
176 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_template_hpp.html" title="Header <boost/tti/has_template.hpp>">has_template.hpp</a></code>
183 Class Template ( not using variadic macros )
188 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TEMPLATE.html" title="Macro BOOST_TTI_HAS_TEMPLATE">BOOST_TTI_HAS_TEMPLATE</a></code>(name,BOOST_PP_NIL)
193 <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code>
196 class TTI_T = enclosing type
199 All of the template parameters must be template type parameters (
200 'class' or 'typename' parameters )
205 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_template_hpp.html" title="Header <boost/tti/has_template.hpp>">has_template.hpp</a></code>
212 Class Template with params ( using variadic macros )
217 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TEMPLATE.html" title="Macro BOOST_TTI_HAS_TEMPLATE">BOOST_TTI_HAS_TEMPLATE</a></code>(name,...<a href="#ftn.the_type_traits_introspection_library.tti_detail.f0" class="footnote" name="the_type_traits_introspection_library.tti_detail.f0"><sup class="footnote">[a]</sup></a>)
222 <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code>
225 class TTI_T = enclosing type
230 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_template_hpp.html" title="Header <boost/tti/has_template.hpp>">has_template.hpp</a></code>
237 Class Template with params
242 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_TEMPLATE.html" title="Macro BOOST_TTI_HAS_TEMPLATE">BOOST_TTI_HAS_TEMPLATE</a></code>(name,ppArray<a href="#ftn.the_type_traits_introspection_library.tti_detail.f1" class="footnote" name="the_type_traits_introspection_library.tti_detail.f1"><sup class="footnote">[b]</sup></a>)
247 <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code>
250 class TTI_T = enclosing type
255 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_template_hpp.html" title="Header <boost/tti/has_template.hpp>">has_template.hpp</a></code>
267 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_MEMBER_DATA.html" title="Macro BOOST_TTI_HAS_MEMBER_DATA">BOOST_TTI_HAS_MEMBER_DATA</a></code>(name)
272 <code class="computeroutput"><span class="identifier">has_member_data_</span><span class="char">'name'</span></code>
275 class TTI_T = enclosing type OR pointer to member data ( 'MemberData_Type
279 class TTI_R = (optional) data type. If the first parameter is the
280 pointer to member data this must not be specified.
285 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_member_data_hpp.html" title="Header <boost/tti/has_member_data.hpp>">has_member_data.hpp</a></code>
297 <code class="computeroutput"><a class="link" href="../BOOST_TT_idm46187185705488.html" title="Macro BOOST_TTI_HAS_MEMBER_FUNCTION">BOOST_TTI_HAS_MEMBER_FUNCTION</a></code>(name)
302 <code class="computeroutput"><span class="identifier">has_member_function_</span><span class="char">'name'</span></code>
305 class TTI_T = enclosing type OR pointer to member function ( 'Return_Type
306 Enclosing_Type::* ( Zero or more comma-separated parameter types
310 class TTI_R = (optional) return type if the first parameter is the
311 enclosing type. If the first parameter is the pointer to member function
312 this must not be specified.
315 class TTI_FS = (optional) function parameter types as a Boost MPL
316 forward sequence. If the first parameter is the pointer to member
317 function this must not be specified. If there are no function parameters
318 this does not have to be specified. Defaults to boost::mpl::vector<>.
321 class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code>
322 tag type. If the first parameter is the pointer to member function
323 this must not be specified. Defaults to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_types</span><span class="special">::</span><span class="identifier">null_tag</span></code>.
328 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_member_function_hpp.html" title="Header <boost/tti/has_member_function.hpp>">has_member_function.hpp</a></code>
340 <code class="computeroutput"><a class="link" href="../BOOST_TT_idm46187185698016.html" title="Macro BOOST_TTI_HAS_STATIC_MEMBER_DATA">BOOST_TTI_HAS_STATIC_MEMBER_DATA</a></code>(name)
345 <code class="computeroutput"><span class="identifier">has_static_member_data_</span><span class="char">'name'</span></code>
348 class TTI_T = enclosing type
351 class TTI_Type = data type
356 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_static_member_data_hpp.html" title="Header <boost/tti/has_static_member_data.hpp>">has_static_member_data.hpp</a></code>
363 Static member function
368 <code class="computeroutput"><a class="link" href="../BOOST_TT_idm46187185690608.html" title="Macro BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION">BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION</a></code>(name)
373 <code class="computeroutput"><span class="identifier">has_static_member_function_</span><span class="char">'name'</span></code>
376 class TTI_T = enclosing type
379 class TTI_R = return type OR function type ( 'Return_Type (Zero or
380 more comma-separated parameter types)' )
383 class TTI_FS = (optional) function parameter types as a Boost MPL
384 forward sequence. If the second parameter is the function type this
385 must not be specified. If there are no function parameters, this
386 does not have to be specified. Defaults to boost::mpl::vector<>.
389 class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code>
390 tag type. If the second parameter is the function type this must
391 not be specified. Defaults to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_types</span><span class="special">::</span><span class="identifier">null_tag</span></code>.
396 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_static_member_function_hpp.html" title="Header <boost/tti/has_static_member_function.hpp>">has_static_member_function.hpp</a></code>
403 Data, either member data or static member data
408 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_DATA.html" title="Macro BOOST_TTI_HAS_DATA">BOOST_TTI_HAS_DATA</a></code>(name)
413 <code class="computeroutput"><span class="identifier">has_data_</span><span class="char">'name'</span></code>
416 class TTI_T = enclosing type
419 class TTI_Type = data type
424 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_data_hpp.html" title="Header <boost/tti/has_data.hpp>">has_data.hpp</a></code>
431 Function, either member function or static member function
436 <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_FUNCTION.html" title="Macro BOOST_TTI_HAS_FUNCTION">BOOST_TTI_HAS_FUNCTION</a></code>(name)
441 <code class="computeroutput"><span class="identifier">has_function_</span><span class="char">'name'</span></code>
444 class TTI_T = enclosing type
447 class TTI_R = return type
450 class TTI_FS = (optional) function parameter types as a Boost MPL
451 forward sequence. If there are no function parameters, this does
452 not have to be specified. Defaults to boost::mpl::vector<>.
455 class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code>
456 tag type. Defaults to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_types</span><span class="special">::</span><span class="identifier">null_tag</span></code>.
461 <code class="computeroutput"><a class="link" href="../header/boost/tti/has_function_hpp.html" title="Header <boost/tti/has_function.hpp>">has_function.hpp</a></code>
466 <tbody class="footnotes"><tr><td colspan="4">
467 <div id="ftn.the_type_traits_introspection_library.tti_detail.f0" class="footnote"><p><a href="#the_type_traits_introspection_library.tti_detail.f0" class="para"><sup class="para">[a] </sup></a>
468 The template parameters as variadic data.
470 <div id="ftn.the_type_traits_introspection_library.tti_detail.f1" class="footnote"><p><a href="#the_type_traits_introspection_library.tti_detail.f1" class="para"><sup class="para">[b] </sup></a>
471 The template parameters as the tuple part of the PP array.
476 <br class="table-break">
478 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
479 <td align="left"></td>
480 <td align="right"><div class="copyright-footer">Copyright © 2011-2013 Tropic Software
482 Distributed under the Boost Software License, Version 1.0. (See accompanying
483 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
488 <div class="spirit-nav">
489 <a accesskey="p" href="tti_functionality.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tti_detail_has_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>