~ubuntu-branches/debian/sid/boost1.49/sid

« back to all changes in this revision

Viewing changes to libs/type_traits/doc/is_same.qbk

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2012-02-26 00:31:44 UTC
  • Revision ID: package-import@ubuntu.com-20120226003144-eaytp12cbf6ubpms
Tags: upstream-1.49.0
ImportĀ upstreamĀ versionĀ 1.49.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_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
__compat If the compiler does not support partial-specialization of class templates, 
 
18
then this template can not be used with abstract, incomplete or function types.
 
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 
 
27
expression that evaluates to /true/.]
 
28
 
 
29
[:`is_same<int const, int>::value` is an integral constant 
 
30
expression that evaluates to /false/.]
 
31
 
 
32
[:`is_same<int&, int>::value` is an integral constant 
 
33
expression that evaluates to /false/.]
 
34
 
 
35
[:`is_same<T, T>::value_type` is the type `bool`.]
 
36
 
 
37
[endsect]
 
38
 
 
39