3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Chapter 1. The Type Traits Introspection Library</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="next" href="the_type_traits_introspection_library/tti_reason.html" title="Why the TTI Library ?">
10 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
11 <table cellpadding="2" width="100%"><tr>
12 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
13 <td align="center"><a href="../../../../index.html">Home</a></td>
14 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
15 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
16 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
17 <td align="center"><a href="../../../../more/index.htm">More</a></td>
20 <div class="spirit-nav"><a accesskey="n" href="the_type_traits_introspection_library/tti_reason.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
22 <div class="titlepage"><div>
23 <div><h2 class="title">
24 <a name="tti"></a>Chapter 1. The Type Traits Introspection Library</h2></div>
25 <div><div class="author"><h3 class="author">
26 <span class="firstname">Edward</span> <span class="surname">Diener</span>
28 <div><p class="copyright">Copyright © 2011-2013 Tropic Software
30 <div><div class="legalnotice">
31 <a name="tti.legal"></a><p>
32 Distributed under the Boost Software License, Version 1.0. (See accompanying
33 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>)
38 <p><b>Table of Contents</b></p>
40 <dt><span class="section"><a href="index.html#the_type_traits_introspection_library.tti_intro">Introduction</a></span></dt>
41 <dd><dl><dt><span class="section"><a href="index.html#the_type_traits_introspection_library.tti_intro.tti_headers">Header
42 Files</a></span></dt></dl></dd>
43 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_reason.html">Why the
44 TTI Library ?</a></span></dt>
45 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_terminology.html">Terminology</a></span></dt>
46 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_functionality.html">General
47 Functionality</a></span></dt>
48 <dd><dl><dt><span class="section"><a href="the_type_traits_introspection_library/tti_functionality.html#the_type_traits_introspection_library.tti_functionality.tti_functionality_nm_gen">Macro
49 metafunction name generation considerations</a></span></dt></dl></dd>
50 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail.html">Macro
51 Metafunctions</a></span></dt>
52 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_type.html">Introspecting
53 an inner type</a></span></dt>
54 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_template.html">Introspecting
55 an inner class template</a></span></dt>
57 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_template.html#the_type_traits_introspection_library.tti_detail_has_template.tti_detail_has_template_macro">Using
58 the BOOST_TTI_HAS_TEMPLATE macro</a></span></dt>
59 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_template/tti_detail_has_template_metafunction.html">Using
60 the has_template_(xxx) metafunction</a></span></dt>
62 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_member_data.html">Introspecting
63 member data</a></span></dt>
64 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_member_function.html">Introspecting
65 member function</a></span></dt>
66 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_static_member_data.html">Introspecting
67 static member data</a></span></dt>
68 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_static_member_function.html">Introspecting
69 static member function</a></span></dt>
70 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_data.html">Introspecting
71 inner data</a></span></dt>
72 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_detail_has_function.html">Introspecting
73 an inner function</a></span></dt>
74 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_nested_type.html">Nested
76 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_func_sig.html">Nested
77 Types and Function Signatures</a></span></dt>
78 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_enclosing_type.html">Enclosing
80 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_usingMM.html">An example
81 using the Macro Metafunctions</a></span></dt>
82 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_func_templates.html">Introspecting
83 Function Templates</a></span></dt>
84 <dt><span class="section"><a href="reference.html">Reference</a></span></dt>
86 <dt><span class="section"><a href="reference.html#header.boost.tti.gen.has_data_gen_hpp">Header <boost/tti/gen/has_data_gen.hpp></a></span></dt>
88 <dt><span class="section"><a href="header/boost/tti/gen/has_function_gen_hpp.html">Header <boost/tti/gen/has_function_gen.hpp></a></span></dt>
90 <dt><span class="section"><a href="header/boost/tti/gen/has_member_data_gen_hpp.html">Header <boost/tti/gen/has_member_data_gen.hpp></a></span></dt>
92 <dt><span class="section"><a href="header/boost/tti/gen/has_member_function_gen_hpp.html">Header <boost/tti/gen/has_member_function_gen.hpp></a></span></dt>
94 <dt><span class="section"><a href="header/boost/tti/gen/has_static_member_data_gen_hpp.html">Header <boost/tti/gen/has_static_member_data_gen.hpp></a></span></dt>
96 <dt><span class="section"><a href="header/boost/tti/gen/has_static_member_function_gen_hpp.html">Header <boost/tti/gen/has_static_member_function_gen.hpp></a></span></dt>
98 <dt><span class="section"><a href="header/boost/tti/gen/has_template_gen_hpp.html">Header <boost/tti/gen/has_template_gen.hpp></a></span></dt>
100 <dt><span class="section"><a href="header/boost/tti/gen/has_type_gen_hpp.html">Header <boost/tti/gen/has_type_gen.hpp></a></span></dt>
102 <dt><span class="section"><a href="header/boost/tti/gen/member_type_gen_hpp.html">Header <boost/tti/gen/member_type_gen.hpp></a></span></dt>
104 <dt><span class="section"><a href="header/boost/tti/gen/namespace_gen_hpp.html">Header <boost/tti/gen/namespace_gen.hpp></a></span></dt>
106 <dt><span class="section"><a href="header/boost/tti/has_data_hpp.html">Header <boost/tti/has_data.hpp></a></span></dt>
108 <dt><span class="section"><a href="header/boost/tti/has_function_hpp.html">Header <boost/tti/has_function.hpp></a></span></dt>
110 <dt><span class="section"><a href="header/boost/tti/has_member_data_hpp.html">Header <boost/tti/has_member_data.hpp></a></span></dt>
112 <dt><span class="section"><a href="header/boost/tti/has_member_function_hpp.html">Header <boost/tti/has_member_function.hpp></a></span></dt>
114 <dt><span class="section"><a href="header/boost/tti/has_static_member_data_hpp.html">Header <boost/tti/has_static_member_data.hpp></a></span></dt>
116 <dt><span class="section"><a href="header/boost/tti/has_static_member_function_hpp.html">Header <boost/tti/has_static_member_function.hpp></a></span></dt>
118 <dt><span class="section"><a href="header/boost/tti/has_template_hpp.html">Header <boost/tti/has_template.hpp></a></span></dt>
120 <dt><span class="section"><a href="header/boost/tti/has_type_hpp.html">Header <boost/tti/has_type.hpp></a></span></dt>
122 <dt><span class="section"><a href="header/boost/tti/member_type_hpp.html">Header <boost/tti/member_type.hpp></a></span></dt>
125 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_tests.html">Testing
127 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_history.html">History</a></span></dt>
128 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_todo.html">ToDo</a></span></dt>
129 <dt><span class="section"><a href="the_type_traits_introspection_library/tti_acknowledgments.html">Acknowledgments</a></span></dt>
130 <dt><span class="section"><a href="index/s24.html">Index</a></span></dt>
133 <div class="section">
134 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
135 <a name="the_type_traits_introspection_library.tti_intro"></a><a class="link" href="index.html#the_type_traits_introspection_library.tti_intro" title="Introduction">Introduction</a>
136 </h2></div></div></div>
137 <div class="toc"><dl class="toc"><dt><span class="section"><a href="index.html#the_type_traits_introspection_library.tti_intro.tti_headers">Header
138 Files</a></span></dt></dl></div>
140 Welcome to the Boost Type Traits Introspection library, abbreviated TTI.
143 TTI is a library which provides the ability to introspect by name the elements
144 of a type at compile time.
147 TTI works through macros generating metafunctions. Metafunctions are class
148 templates of a particular syntax, having a nested 'type' member. So wherever
149 in C++ class templates can occur, TTI macros can be used. The metafunctions
150 generated by TTI are no different from any other metafunction as defined by
151 the Boost MPL library.
154 The metafunctions generated by TTI are used to introspect elements of a type
155 at compile time, always passing at minimum to each metafunction the enclosing
156 type being introspected.
159 The name of the library has been chosen because the library offers compile
160 time functionality on a type, similar to the Boost Type Traits library, and
161 because the functionality the library offers is the ability to introspect a
162 type about the existence of a specific element within that type.
165 I use the word "introspect" in a very broad sense here. Normally
166 computer language introspection means initially asking for information to be
167 returned by name, which can then further be used to introspect for more specific
168 information. In the TTI library one must always know and supply the name, and
169 use the functionality provided for the correct type of inner element to find
170 out if that particular named entity exists.
173 You may prefer the term "query" instead of "introspection"
174 to denote what this library does, but I use terminology based on the word "introspect"
175 throughout this documentation.
178 The functionality of the library may be summed up as:
180 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
181 <li class="listitem">
182 Provide the means to introspect a type at compile time using a set of macros.
183 Each macro takes the name of the type's element and generates a metafunction
184 which can be subsequently invoked to determine whether or not the element
185 exists within the type. These generated metafunctions will be called "macro
186 metafunctions" in the documentation.
188 <li class="listitem">
189 Provide the means to create a typedef for a type which may not exist. This
190 typedef type can be used as a type in the metafunctions of the library
191 without producing compile-time errors.
195 The library is dependent on Boost PP, Boost MPL, Boost Type Traits, and Boost
199 The library is also dependent on the variadic macro support of the Boost PP
200 library if the variadic macros in the library are used.
203 The library is a header only library.
206 Since the dependencies of the library are all header only libraries, there
207 is no need to build a library in order to use the TTI library.
209 <div class="section">
210 <div class="titlepage"><div><div><h3 class="title">
211 <a name="the_type_traits_introspection_library.tti_intro.tti_headers"></a><a class="link" href="index.html#the_type_traits_introspection_library.tti_intro.tti_headers" title="Header Files">Header
213 </h3></div></div></div>
215 There are is a single header file, <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tti</span><span class="special">/</span><span class="identifier">tti</span><span class="special">.</span><span class="identifier">hpp</span></code>,
216 which includes all the header files in the library.
219 There are also separate specific header files for each of the elements to
220 be introspected by the library. This allows for finer-grained inclusion of
221 the nested elements to be introspected. These header files are:
224 <a name="the_type_traits_introspection_library.tti_intro.tti_headers.tbhfiles"></a><p class="title"><b>Table 1.1. TTI Header Files</b></p>
225 <div class="table-contents"><table class="table" summary="TTI Header Files">
251 <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>
263 <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>
275 <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>
287 <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>
299 <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>
306 Static member function
311 <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>
323 <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>
335 <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>
347 <code class="computeroutput"><a class="link" href="header/boost/tti/member_type_hpp.html" title="Header <boost/tti/member_type.hpp>">member_type.hpp</a></code>
354 <br class="table-break">
358 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
359 <td align="left"><p><small>Last revised: December 10, 2019 at 00:21:49 GMT</small></p></td>
360 <td align="right"><div class="copyright-footer"></div></td>
363 <div class="spirit-nav"><a accesskey="n" href="the_type_traits_introspection_library/tti_reason.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>