source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/negate.rst
@
12
| Last change on this file since 12 was 12, checked in by landauf, 18 years ago | |
|---|---|
| File size: 1.9 KB | |
negate
Synopsis
template<
typename T
>
struct negate
{
typedef |unspecified| type;
};
Description
Returns the negative (additive inverse) of its argument.
Header
#include <boost/mpl/negate.hpp> #include <boost/mpl/arithmetic.hpp>
Model of
Parameters
| Parameter | Requirement | Description |
|---|---|---|
| T | |Integral Constant| | Operation's argument. |
Expression semantics
For any |Integral Constant| c:
typedef negate<c>::type r;
| Return type: | |
|---|---|
| Semantics: | Equivalent to typedef integral_c< c::value_type, ( -c::value ) > r; |
typedef negate<c> r;
| Return type: | |
|---|---|
| Semantics: | Equivalent to
struct r : negate<c>::type {};
|
Complexity
Amortized constant time.
Example
typedef negate< int_<-10> >::type r; BOOST_MPL_ASSERT_RELATION( r::value, ==, 10 ); BOOST_MPL_ASSERT(( is_same< r::value_type, int > ));
Note: See TracBrowser
for help on using the repository browser.










