3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Introduction
</title>
5 <link rel=
"stylesheet" href=
"../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.76.1">
7 <link rel=
"home" href=
"../index.html" title=
"Chapter 1. Boost.FunctionTypes 2.5">
8 <link rel=
"up" href=
"../index.html" title=
"Chapter 1. Boost.FunctionTypes 2.5">
9 <link rel=
"prev" href=
"../index.html" title=
"Chapter 1. Boost.FunctionTypes 2.5">
10 <link rel=
"next" href=
"use_cases.html" title=
"Use Cases">
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=
"../index.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=
"use_cases.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=
"boost_functiontypes.introduction"></a><a class=
"link" href=
"introduction.html" title=
"Introduction">Introduction
</a>
28 </h2></div></div></div>
30 Boost.FunctionTypes provides functionality to classify, decompose and synthesize
31 function, function pointer, function reference and pointer to member types.
34 We collectively refer to these types as
<span class=
"emphasis"><em>callable builtin
</em></span>
38 In particular, the library can be used to:
40 <div class=
"itemizedlist"><ul class=
"itemizedlist" type=
"disc">
42 test whether a type is a specific callable, builtin type,
45 extract all component properties from callable, builtin types, and
48 create callable, builtin types from specified properties.
52 The library is designed to work well with other Boost libraries and uses well-accepted
53 concepts introduced by Boost and TR1.
56 Templates that encapsulate boolean or numeric properties define a static member
57 constant called
<code class=
"literal">value
</code>.
59 <pre class=
"programlisting"><a class=
"link" href=
"reference/classification.html#boost_functiontypes.reference.classification.is_function_pointer" title=
"is_function_pointer">is_function_pointer
</a><span class=
"special"><</span> <span class=
"keyword">bool
</span><span class=
"special">(*)(
</span><span class=
"keyword">int
</span><span class=
"special">)
</span> <span class=
"special">>::
</span><span class=
"identifier">value
</span> <span class=
"comment">// == true
61 <a class=
"link" href=
"reference/decomposition.html#boost_functiontypes.reference.decomposition.function_arity" title=
"function_arity">function_arity
</a><span class=
"special"><</span> <span class=
"keyword">bool
</span><span class=
"special">(*)(
</span><span class=
"keyword">int
</span><span class=
"special">)
</span> <span class=
"special">>::
</span><span class=
"identifier">value
</span> <span class=
"comment">// ==
1
64 Templates that encapsulate properties that are single types contain a type
65 member called
<code class=
"literal">type
</code>.
67 <pre class=
"programlisting"><a class=
"link" href=
"reference/synthesis.html#boost_functiontypes.reference.synthesis.function_type" title=
"function_type">function_type
</a><span class=
"special"><</span> <span class=
"identifier">mpl
</span><span class=
"special">::
</span><span class=
"identifier">vector
</span><span class=
"special"><</span><span class=
"keyword">bool
</span><span class=
"special">,
</span><span class=
"keyword">int
</span><span class=
"special">></span> <span class=
"special">>::
</span><span class=
"identifier">type
</span> <span class=
"comment">// is bool(int)
69 <a class=
"link" href=
"reference/decomposition.html#boost_functiontypes.reference.decomposition.result_type" title=
"result_type">result_type
</a><span class=
"special"><</span> <span class=
"keyword">bool
</span><span class=
"special">(
&)(
</span><span class=
"keyword">int
</span><span class=
"special">)
</span> <span class=
"special">>::
</span><span class=
"identifier">type
</span> <span class=
"comment">// is bool
72 Templates that encapsulate properties that are type lists model an MPL-compatible
75 <pre class=
"programlisting"><a class=
"link" href=
"reference/decomposition.html#boost_functiontypes.reference.decomposition.parameter_types" title=
"parameter_types">parameter_types
</a><span class=
"special"><</span> <span class=
"keyword">bool
</span><span class=
"special">(
</span><span class=
"keyword">int
</span><span class=
"special">)
</span> <span class=
"special">></span> <span class=
"comment">// models an MPL sequence
78 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
79 <td align=
"left"></td>
80 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2004-
2007 Tobias
82 Distributed under the Boost Software License, Version
1.0. (See accompanying
83 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>)
88 <div class=
"spirit-nav">
89 <a accesskey=
"p" href=
"../index.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=
"use_cases.html"><img src=
"../../../../../doc/src/images/next.png" alt=
"Next"></a>