]>
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:promote promote] | |
9 | ||
10 | template <class T> | |
11 | struct promote | |
12 | { | |
13 | typedef __below type; | |
14 | }; | |
15 | ||
16 | __type If integral or floating point promotion can be applied to an rvalue | |
17 | of type `T`, then applies integral and floating point promotions to `T` and | |
18 | keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also | |
19 | __integral_promotion and __floating_point_promotion. | |
20 | ||
21 | __std_ref 4.5 except 4.5/3 (integral bit-field) and 4.6. | |
22 | ||
23 | [all_compilers] | |
24 | ||
25 | __header ` #include <boost/type_traits/promote.hpp>` or ` #include <boost/type_traits.hpp>` | |
26 | ||
27 | [table Examples | |
28 | ||
29 | [ [Expression] [Result Type]] | |
30 | ||
31 | [[`promote<short volatile>::type`][`int volatile`]] | |
32 | ||
33 | [[`promote<float const>::type`][`double const`]] | |
34 | ||
35 | [[`promote<short&>::type`][`short&`]] | |
36 | ||
37 | ] | |
38 | ||
39 | [endsect] | |
40 |