blob: ed931c1390c15fb0aca1001057eee86387fc0bfb [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
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_same is_same]
9 template <class T, class U>
10 struct is_same : public __tof {};
11
12__inherit If T and U are the same types then inherits from
13__true_type, otherwise inherits from __false_type.
14
15__header ` #include <boost/type_traits/is_same.hpp>` or ` #include <boost/type_traits.hpp>`
16
17[all_compilers]
18
19
20__examples
21
22[:`is_same<int, int>` inherits from `__true_type`.]
23
24[:`is_same<int, int>::type` is the type `__true_type`.]
25
26[:`is_same<int, int>::value` is an integral constant
27expression that evaluates to /true/.]
28
29[:`is_same<int const, int>::value` is an integral constant
30expression that evaluates to /false/.]
31
32[:`is_same<int&, int>::value` is an integral constant
33expression that evaluates to /false/.]
34
35[:`is_same<T, T>::value_type` is the type `bool`.]
36
37[endsect]
38
39