...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Metafunctions / Arithmetic Operations / minus |
template< typename T1 , typename T2 , typename T3 = unspecified ... , typename Tn = unspecified > struct minus { typedef unspecified type; };
Returns the difference of its arguments.
#include <boost/mpl/minus.hpp> #include <boost/mpl/arithmetic.hpp>
Parameter | Requirement | Description |
---|---|---|
T1, T2,... Tn | Integral Constant | Operation's arguments. |
[Note: The requirements listed in this specification are the ones imposed by the default implementation. See Numeric Metafunction concept for the details on how to provide an implementation for a user-defined numeric type that does not satisfy the Integral Constant requirements. — end note]
For any Integral Constants c1,c2,... cn:
typedef minus<c1,...cn>::type r;
Return type: | |
---|---|
Semantics: | Equivalent to typedef integral_c< typeof(c1::value - c2::value) , ( c1::value - c2::value ) > c; typedef minus<c,c3,...cn>::type r; |
typedef minus<c1,...cn> r;
Return type: | |
---|---|
Semantics: | Equivalent to struct r : minus<c1,...cn>::type {}; |
Amortized constant time.
typedef minus< int_<-10>, int_<3>, long_<1> >::type r; BOOST_MPL_ASSERT_RELATION( r::value, ==, -14 ); BOOST_MPL_ASSERT(( is_same< r::value_type, long > ));