1 .. Metafunctions/Arithmetic Operations//plus |10
14 , typename T3 = |unspecified|
16 , typename T\ *n* = |unspecified|
20 typedef |unspecified| type;
28 Returns the sum of its arguments.
36 #include <boost/mpl/plus.hpp>
37 #include <boost/mpl/arithmetic.hpp>
43 |Numeric Metafunction|
50 +---------------+---------------------------+-----------------------------------------------+
51 | Parameter | Requirement | Description |
52 +===============+===========================+===============================================+
53 | |T1...Tn| | |Integral Constant| | Operation's arguments. |
54 +---------------+---------------------------+-----------------------------------------------+
56 |Note:| |numeric metafunction note| |-- end note|
62 For any |Integral Constant|\ s |c1...cn|:
67 typedef plus<c1,\ |...|\ c\ *n*\>::type r;
78 typeof(c1::value + c2::value)
79 , ( c1::value + c2::value )
82 typedef plus<c,c3,\ |...|\c\ *n*\>::type r;
84 .. ..........................................................................
88 typedef plus<c1,\ |...|\ c\ *n*\> r;
98 struct r : plus<c1,\ |...|\ c\ *n*\>::type {};
106 Amortized constant time.
114 typedef plus< int_<-10>, int_<3>, long_<1> >::type r;
115 BOOST_MPL_ASSERT_RELATION( r::value, ==, -6 );
116 BOOST_MPL_ASSERT(( is_same< r::value_type, long > ));
122 |Arithmetic Operations|, |Numeric Metafunction|, |numeric_cast|, |minus|, |negate|, |times|
125 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
126 Distributed under the Boost Software License, Version 1.0. (See accompanying
127 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)