]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/add_reference.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / add_reference.qbk
CommitLineData
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:add_reference add_reference]
9
10[note This trait has been made obsolete by __add_lvalue_reference and __add_rvalue_reference,
11and new code should use these new traits rather than __is_reference which is retained
12for backwards compatibility only.
13]
14
15
16 template <class T>
17 struct add_reference
18 {
19 typedef __below type;
20 };
21
22__type If `T` is not a reference type then `T&`, otherwise `T`.
23
24__std_ref 8.3.2.
25
26__header ` #include <boost/type_traits/add_reference.hpp>` or ` #include <boost/type_traits.hpp>`
27
28[table Examples
29
30[ [Expression] [Result Type]]
31
32[[`add_reference<int>::type`][`int&`]]
33
34[[`add_reference<int const&>::type`] [`int const&`]]
35
36[[`add_reference<int*>::type`] [`int*&`]]
37
38[[`add_reference<int*&>::type`] [`int*&`]]
39
40]
41
42[all_compilers]
43
44[endsect]
45