3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>About Tag Types
</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=
"use_cases.html" title=
"Use Cases">
10 <link rel=
"next" href=
"reference.html" title=
"Reference">
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=
"use_cases.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=
"reference.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.about_tag_types"></a><a class=
"link" href=
"about_tag_types.html" title=
"About Tag Types">About Tag Types
</a>
28 </h2></div></div></div>
30 Boost.FunctionTypes uses tag types to encode properties that are not types
31 per se, such as calling convention or whether a function is variadic or cv-
35 These tags can be used to determine whether one property of a type has a particular
38 <pre class=
"programlisting"><span class=
"identifier">is_function
</span><span class=
"special"><</span><span class=
"keyword">int
</span><span class=
"special">(...),
</span> <span class=
"identifier">variadic
</span><span class=
"special">>::
</span><span class=
"identifier">value
</span> <span class=
"comment">// == true
39 </span><span class=
"identifier">is_function
</span><span class=
"special"><</span><span class=
"keyword">int
</span><span class=
"special">()
</span> <span class=
"special">,
</span> <span class=
"identifier">variadic
</span><span class=
"special">>::
</span><span class=
"identifier">value
</span> <span class=
"comment">// == false
42 A compound property tag describes a combination of possible values of different
43 properties. The type
<code class=
"literal">components
<F
></code>, where
<code class=
"literal">F
</code>
44 is a callable builtin type, is a compound property tag that describes
<code class=
"literal">F
</code>.
45 The
<code class=
"literal">tag
</code> class template can be used to combine property tags.
47 <pre class=
"programlisting"><span class=
"identifier">tag
</span><span class=
"special"><</span><span class=
"identifier">non_const
</span><span class=
"special">,
</span><span class=
"identifier">default_cc
</span><span class=
"special">></span> <span class=
"comment">// combination of two properties
50 When several values for the same property are specified in
<code class=
"literal">tag
</code>'s
51 argument list, only the rightmost one is used; others are ignored.
53 <pre class=
"programlisting"><span class=
"identifier">tag
</span><span class=
"special"><</span><span class=
"identifier">components
</span><span class=
"special"><</span><span class=
"identifier">F
</span><span class=
"special">>,
</span> <span class=
"identifier">default_cc
</span><span class=
"special">></span> <span class=
"comment">// overrides F's calling convention property
56 When compound property tag is specified to analyse a type, all of its component
57 properties must match.
59 <pre class=
"programlisting"><span class=
"identifier">is_member_function_pointer
</span><span class=
"special"><</span> <span class=
"identifier">F
</span><span class=
"special">,
</span> <span class=
"identifier">tag
</span><span class=
"special"><</span><span class=
"identifier">const_qualified
</span><span class=
"special">,
</span><span class=
"identifier">default_cc
</span><span class=
"special">></span> <span class=
"special">>::
</span><span class=
"identifier">value
</span>
60 <span class=
"comment">// true for
61 </span><span class=
"comment">// F = void(a_class::*)() const
62 </span><span class=
"comment">// false for
63 </span><span class=
"comment">// F = void(a_class::*)()
64 </span><span class=
"comment">// F = void(__fastcall a_class::*)() const
67 Default values are selected for properties not specified by the tag in the
68 context of type synthesis.
70 <pre class=
"programlisting"><span class=
"comment">// given S = mpl::vector
<int,a_class const
&>
72 <span class=
"identifier">member_function_pointer
</span><span class=
"special"><</span><span class=
"identifier">S
</span><span class=
"special">>::
</span><span class=
"identifier">type
</span> <span class=
"comment">// is int (a_class::*)() const
73 </span><span class=
"comment">// note: the cv-qualification is picked based on the class type,
74 </span><span class=
"comment">// a nonvariadic signature and the default calling convention
75 </span><span class=
"comment">// are used
77 <span class=
"identifier">member_function_pointer
</span><span class=
"special"><</span><span class=
"identifier">S
</span><span class=
"special">,
</span><span class=
"identifier">non_const
</span><span class=
"special">>::
</span><span class=
"identifier">type
</span> <span class=
"comment">// is int (a_class::*)()
78 </span><span class=
"comment">// no const qualification, as explicitly specified by the tag type
81 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
82 <td align=
"left"></td>
83 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2004-
2007 Tobias
85 Distributed under the Boost Software License, Version
1.0. (See accompanying
86 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>)
91 <div class=
"spirit-nav">
92 <a accesskey=
"p" href=
"use_cases.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=
"reference.html"><img src=
"../../../../../doc/src/images/next.png" alt=
"Next"></a>