1 .. Metafunctions/Arithmetic Operations//negate |60
16 typedef |unspecified| type;
24 Returns the negative (additive inverse) of its argument.
32 #include <boost/mpl/negate.hpp>
33 #include <boost/mpl/arithmetic.hpp>
39 |Numeric Metafunction|
45 +---------------+---------------------------+-----------------------------------------------+
46 | Parameter | Requirement | Description |
47 +===============+===========================+===============================================+
48 | ``T`` | |Integral Constant| | Operation's argument. |
49 +---------------+---------------------------+-----------------------------------------------+
51 |Note:| |numeric metafunction note| |-- end note|
57 For any |Integral Constant| ``c``:
61 typedef negate<c>::type r;
71 typedef integral_c< c::value_type, ( -c::value ) > r;
73 .. ..........................................................................
87 struct r : negate<c>::type {};
93 Amortized constant time.
101 typedef negate< int_<-10> >::type r;
102 BOOST_MPL_ASSERT_RELATION( r::value, ==, 10 );
103 BOOST_MPL_ASSERT(( is_same< r::value_type, int > ));
109 |Arithmetic Operations|, |Numeric Metafunction|, |numeric_cast|, |plus|, |minus|, |times|
112 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
113 Distributed under the Boost Software License, Version 1.0. (See accompanying
114 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)