]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | .. Metafunctions/Comparisons//not_equal_to |60 |
2 | ||
3 | not_equal_to | |
4 | ============ | |
5 | ||
6 | Synopsis | |
7 | -------- | |
8 | ||
9 | .. parsed-literal:: | |
10 | ||
11 | template< | |
12 | typename T1 | |
13 | , typename T2 | |
14 | > | |
15 | struct not_equal_to | |
16 | { | |
17 | typedef |unspecified| type; | |
18 | }; | |
19 | ||
20 | ||
21 | ||
22 | Description | |
23 | ----------- | |
24 | ||
25 | Returns a true-valued |Integral Constant| if ``T1`` and ``T2`` are not equal. | |
26 | ||
27 | ||
28 | Header | |
29 | ------ | |
30 | ||
31 | .. parsed-literal:: | |
32 | ||
33 | #include <boost/mpl/not_equal_to.hpp> | |
34 | #include <boost/mpl/comparison.hpp> | |
35 | ||
36 | ||
37 | Model of | |
38 | -------- | |
39 | ||
40 | |Numeric Metafunction| | |
41 | ||
42 | ||
43 | Parameters | |
44 | ---------- | |
45 | ||
46 | +---------------+---------------------------+-----------------------------------------------+ | |
47 | | Parameter | Requirement | Description | | |
48 | +===============+===========================+===============================================+ | |
49 | | ``T1``, ``T2``| |Integral Constant| | Operation's arguments. | | |
50 | +---------------+---------------------------+-----------------------------------------------+ | |
51 | ||
52 | |Note:| |numeric metafunction note| |-- end note| | |
53 | ||
54 | ||
55 | Expression semantics | |
56 | -------------------- | |
57 | ||
58 | ||
59 | For any |Integral Constant|\ s ``c1`` and ``c2``: | |
60 | ||
61 | .. parsed-literal:: | |
62 | ||
63 | typedef not_equal_to<c1,c2>::type r; | |
64 | ||
65 | :Return type: | |
66 | |Integral Constant|. | |
67 | ||
68 | :Semantics: | |
69 | Equivalent to | |
70 | ||
71 | .. parsed-literal:: | |
72 | ||
73 | typedef bool_< (c1::value != c2::value) > r; | |
74 | ||
75 | ||
76 | .. .......................................................................... | |
77 | ||
78 | .. parsed-literal:: | |
79 | ||
80 | typedef not_equal_to<c1,c2> r; | |
81 | ||
82 | :Return type: | |
83 | |Integral Constant|. | |
84 | ||
85 | :Semantics: | |
86 | Equivalent to | |
87 | ||
88 | .. parsed-literal:: | |
89 | ||
90 | struct r : not_equal_to<c1,c2>::type {}; | |
91 | ||
92 | ||
93 | ||
94 | Complexity | |
95 | ---------- | |
96 | ||
97 | Amortized constant time. | |
98 | ||
99 | ||
100 | Example | |
101 | ------- | |
102 | ||
103 | .. parsed-literal:: | |
104 | ||
105 | BOOST_MPL_ASSERT(( not_equal_to< int_<0>, int_<10> > )); | |
106 | BOOST_MPL_ASSERT(( not_equal_to< long_<10>, int_<0> > )); | |
107 | BOOST_MPL_ASSERT_NOT(( not_equal_to< long_<10>, int_<10> > )); | |
108 | ||
109 | ||
110 | See also | |
111 | -------- | |
112 | ||
113 | |Comparisons|, |Numeric Metafunction|, |numeric_cast|, |equal_to|, |less| | |
114 | ||
115 | ||
116 |