| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
| <title>Macro Metafunctions</title> |
| <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> |
| <link rel="home" href="../index.html" title="Chapter 1. The Type Traits Introspection Library"> |
| <link rel="up" href="../index.html" title="Chapter 1. The Type Traits Introspection Library"> |
| <link rel="prev" href="tti_functionality.html" title="General Functionality"> |
| <link rel="next" href="tti_detail_has_type.html" title="Introspecting an inner type"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table cellpadding="2" width="100%"><tr> |
| <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> |
| <td align="center"><a href="../../../../../index.html">Home</a></td> |
| <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> |
| <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> |
| <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> |
| <td align="center"><a href="../../../../../more/index.htm">More</a></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <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> |
| </div> |
| <div class="section"> |
| <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
| <a name="the_type_traits_introspection_library.tti_detail"></a><a class="link" href="tti_detail.html" title="Macro Metafunctions">Macro |
| Metafunctions</a> |
| </h2></div></div></div> |
| <p> |
| The TTI library uses macros to create metafunctions, in the current scope, |
| for introspecting an inner element by name. Each macro for a particular type |
| of inner element has two forms, the simple one where the first macro parameter |
| designating the 'name' of the inner element is used to create the name of the |
| metafunction, and the complex one where the first macro parameter, called 'trait', |
| designates the name of the metafunction and the second macro parameter designates |
| the 'name' to be introspected. Other than that difference, the two forms of |
| the macro create metafunctions which have the exact same functionality. |
| </p> |
| <p> |
| To use these metafunctions you can include the main general header file 'boost/tti/tti.hpp', |
| unless otherwise noted. Alternatively you can include a specific header file |
| as given in the table below. |
| </p> |
| <p> |
| A table of these macros is given, based on the inner element whose existence |
| the metaprogrammer is introspecting. More detailed explanations and examples |
| for each of the macro metafunctions will follow this section in the documentation. |
| The actual syntax for each macro metafunction can be found in the reference |
| section, and examples of usage for all the macro metafunctions can be found |
| in the <a class="link" href="tti_usingMM.html#sectti_usingMM">"Using the Macro Metafunctions"</a> |
| section. |
| </p> |
| <p> |
| In the Template column only the name generated by the simple form of the template |
| is given since the name generated by the complex form is always 'trait' where |
| 'trait' is the first parameter to the corresponding complex form macro. |
| </p> |
| <p> |
| All of the introspecting metafunctions in the table below return a boolean |
| constant called 'value', which specifies whether or not the inner element exists. |
| All of the metafunctions also have a nested type called 'type', which for each |
| one is the type of the boolean constant value. This is always boost::mpl::bool_. |
| </p> |
| <div class="table"> |
| <a name="the_type_traits_introspection_library.tti_detail.tbmacros"></a><p class="title"><b>Table 1.2. TTI Macro Metafunctions</b></p> |
| <div class="table-contents"><table class="table" summary="TTI Macro Metafunctions"> |
| <colgroup> |
| <col> |
| <col> |
| <col> |
| <col> |
| </colgroup> |
| <thead><tr> |
| <th> |
| <p> |
| Inner Element |
| </p> |
| </th> |
| <th> |
| <p> |
| Macro |
| </p> |
| </th> |
| <th> |
| <p> |
| Template |
| </p> |
| </th> |
| <th> |
| <p> |
| Specific Header File |
| </p> |
| </th> |
| </tr></thead> |
| <tbody> |
| <tr> |
| <td> |
| <p> |
| Type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_type_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Type with lambda expression |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_type_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| class TTI_U = lambda expression invoked with the inner type and returning |
| a boolean constant |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Class Template ( using variadic macros ) |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| All of the template parameters must be template type parameters ( |
| 'class' or 'typename' parameters ) |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Class Template ( not using variadic macros ) |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| All of the template parameters must be template type parameters ( |
| 'class' or 'typename' parameters ) |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Class Template with params ( using variadic macros ) |
| </p> |
| </td> |
| <td> |
| <p> |
| <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>) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Class Template with params |
| </p> |
| </td> |
| <td> |
| <p> |
| <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>) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_template_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Member data |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_member_data_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type OR pointer to member data ( 'MemberData_Type |
| Enclosing_Type::*' ) |
| </p> |
| <p> |
| class TTI_R = (optional) data type If the first parameter is the |
| pointer to member data this must not be specified. |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Member function |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_MEMBER_FUNCTION.html" title="Macro BOOST_TTI_HAS_MEMBER_FUNCTION">BOOST_TTI_HAS_MEMBER_FUNCTION</a></code>(name) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_member_function_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type OR pointer to member function ( 'Return_Type |
| Enclosing_Type::* ( Zero or more comma-separated parameter types |
| )' ) |
| </p> |
| <p> |
| class TTI_R = (optional) return type if the first parameter is the |
| enclosing type. If the first parameter is the pointer to member function |
| this must not be specified. |
| </p> |
| <p> |
| class TTI_FS = (optional) function parameter types as a Boost MPL |
| forward sequence. If the first parameter is the pointer to member |
| function this must not be specified. If there are no function parameters |
| this does not have to be specified. Defaults to boost::mpl::vector<>. |
| </p> |
| <p> |
| class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code> |
| tag type. If the first parameter is the pointer to member function |
| 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>. |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Static member data |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_STATIC_MEMBER_DATA.html" title="Macro BOOST_TTI_HAS_STATIC_MEMBER_DATA">BOOST_TTI_HAS_STATIC_MEMBER_DATA</a></code>(name) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_static_member_data_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| class TTI_Type = data type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Static member function |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><a class="link" href="../BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION.html" title="Macro BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION">BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION</a></code>(name) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_static_member_function_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| class TTI_R = return type OR function type ( 'Return_Type (Zero or |
| more comma-separated parameter types)' ) |
| </p> |
| <p> |
| class TTI_FS = (optional) function parameter types as a Boost MPL |
| forward sequence. If the second parameter is the function type this |
| must not be specified. If there are no function parameters, this |
| does not have to be specified. Defaults to boost::mpl::vector<>. |
| </p> |
| <p> |
| class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code> |
| tag type. If the second parameter is the function type 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>. |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Data, either member data or static member data |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_data_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| class TTI_Type = data type |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| Function, either member function or static member function |
| </p> |
| </td> |
| <td> |
| <p> |
| <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) |
| </p> |
| </td> |
| <td> |
| <p> |
| <code class="computeroutput"><span class="identifier">has_function_</span><span class="char">'name'</span></code> |
| </p> |
| <p> |
| class TTI_T = enclosing type |
| </p> |
| <p> |
| class TTI_R = return type |
| </p> |
| <p> |
| class TTI_FS = (optional) function parameter types as a Boost MPL |
| forward sequence. If there are no function parameters, this does |
| not have to be specified. Defaults to boost::mpl::vector<>. |
| </p> |
| <p> |
| class TTI_TAG = (optional) Boost <code class="computeroutput"><span class="identifier">function_types</span></code> |
| 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>. |
| </p> |
| </td> |
| <td> |
| <p> |
| <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> |
| </p> |
| </td> |
| </tr> |
| </tbody> |
| <tbody class="footnotes"><tr><td colspan="4"> |
| <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> |
| The template parameters as variadic data. |
| </p></div> |
| <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> |
| The template parameters as the tuple part of the PP array. |
| </p></div> |
| </td></tr></tbody> |
| </table></div> |
| </div> |
| <br class="table-break"> |
| </div> |
| <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"></td> |
| <td align="right"><div class="copyright-footer">Copyright © 2011-2013 Tropic Software |
| East Inc<p> |
| Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 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>) |
| </p> |
| </div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <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> |
| </div> |
| </body> |
| </html> |