1 .. Metafunctions/Arithmetic Operations//modulus |50
17 typedef |unspecified| type;
25 Returns the modulus of its arguments.
33 #include <boost/mpl/modulus.hpp>
34 #include <boost/mpl/arithmetic.hpp>
40 |Numeric Metafunction|
46 +---------------+---------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===========================+===============================================+
49 | ``T1``, ``T2``| |Integral Constant| | Operation's arguments. |
50 +---------------+---------------------------+-----------------------------------------------+
52 |Note:| |numeric metafunction note| |-- end note|
58 For any |Integral Constant|\ s ``c1`` and ``c2``:
63 typedef modulus<c1,c2>::type r;
77 typeof(c1::value % c2::value)
78 , ( c1::value % c2::value )
82 .. ..........................................................................
86 typedef modulus<c1,c2> r;
99 struct r : modulus<c1,c2>::type {};
105 Amortized constant time.
113 typedef modulus< int_<10>, long_<3> >::type r;
114 BOOST_MPL_ASSERT_RELATION( r::value, ==, 1 );
115 BOOST_MPL_ASSERT(( is_same< r::value_type, long > ));
122 |Metafunctions|, |Numeric Metafunction|, |numeric_cast|, |divides|, |times|, |plus|
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)