]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright 2007 John Maddock. | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt). | |
6 | ] | |
7 | ||
8 | [section:decay decay] | |
9 | ||
10 | template <class T> | |
11 | struct decay | |
12 | { | |
13 | typedef __below type; | |
14 | }; | |
15 | ||
16 | __type Let `U` be the result of `remove_reference<T>::type`, then if `U` is | |
17 | an array type, the result is `remove_extent<U>::type*`, otherwise if `U` is a | |
18 | function type then the result is `U*`, otherwise the result is `U`. | |
19 | ||
20 | __std_ref 3.9.1. | |
21 | ||
22 | __header ` #include <boost/type_traits/decay.hpp>` or ` #include <boost/type_traits.hpp>` | |
23 | ||
24 | [table Examples | |
25 | ||
26 | [ [Expression] [Result Type]] | |
27 | ||
28 | [[`decay<int[2][3]>::type`][`int[3]*`]] | |
29 | ||
30 | [[`decay<int(&)[2]>::type`] [`int*`]] | |
31 | ||
32 | [[`decay<int(&)(double)>::type`] [`int(*)(double)`]] | |
33 | ||
34 | [[`int(*)(double)`] [`int(*)(double)`]] | |
35 | [[`int(double)`] [`int(*)(double)`]] | |
36 | ||
37 | ] | |
38 | ||
39 | [all_compilers] | |
40 | ||
41 | [endsect] | |
42 |