]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/doc/add_rvalue_reference.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / doc / add_rvalue_reference.qbk
1 [/
2 Copyright 2010 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:add_rvalue_reference add_rvalue_reference]
9
10 template <class T>
11 struct add_rvalue_reference
12 {
13 typedef __below type;
14 };
15
16 __type If `T` names an object or function type then the member typedef type
17 shall name `T&&`; otherwise, type shall name `T`. ['\[Note: This rule reflects
18 the semantics of reference collapsing. For example, when a type `T` names
19 a type U&, the type `add_rvalue_reference<T>::type` is not an rvalue
20 reference. -end note\]].
21
22 __std_ref 20.7.6.2.
23
24 __header ` #include <boost/type_traits/add_rvalue_reference.hpp>` or ` #include <boost/type_traits.hpp>`
25
26 [table Examples
27
28 [ [Expression] [Result Type]]
29
30 [[`add_rvalue_reference<int>::type`][`int&&`]]
31
32 [[`add_rvalue_reference<int const&>::type`] [`int const&`]]
33
34 [[`add_rvalue_reference<int*>::type`] [`int*&&`]]
35
36 [[`add_rvalue_reference<int*&>::type`] [`int*&`]]
37
38 [[`add_rvalue_reference<int&&>::type`][`int&&`]]
39
40 [[`add_rvalue_reference<void>::type`][`void`]]
41
42 ]
43
44 __compat In the absence of rvalue-reference support this trait has no effect.
45
46 [endsect]
47