]>
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:is_reference is_reference] | |
9 | template <class T> | |
10 | struct is_reference : public __tof {}; | |
11 | ||
12 | __inherit If T is a reference type (either an lvalue reference or an rvalue reference) | |
13 | then inherits from __true_type, | |
14 | otherwise inherits from __false_type. | |
15 | ||
16 | __std_ref 3.9.2 and 8.3.2. | |
17 | ||
18 | [all_compilers] | |
19 | ||
20 | __header ` #include <boost/type_traits/is_reference.hpp>` or ` #include <boost/type_traits.hpp>` | |
21 | ||
22 | __examples | |
23 | ||
24 | [:`is_reference<int&>` inherits from `__true_type`.] | |
25 | ||
26 | [:`is_reference<int const&>::type` is the type `__true_type`.] | |
27 | ||
28 | [:`is_reference<int const&&>::type` is the type `__true_type`.] | |
29 | ||
30 | [:`is_reference<int (&)(long)>::value` is an integral constant | |
31 | expression that evaluates to /true/ (the argument in this case is | |
32 | a reference to a function).] | |
33 | ||
34 | [:`is_reference<T>::value_type` is the type `bool`.] | |
35 | ||
36 | [endsect] | |
37 |