]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/test/arithmetic.cpp
2 // Copyright Aleksey Gurtovoy 2001-2004
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/libs/mpl for documentation.
14 #include <boost/mpl/arithmetic.hpp>
15 #include <boost/mpl/int.hpp>
16 #include <boost/mpl/aux_/test.hpp>
25 MPL_ASSERT_RELATION( (plus
<_0
,_10
>::value
), ==, 10 );
26 MPL_ASSERT_RELATION( (plus
<_10
,_0
>::value
), ==, 10 );
28 MPL_ASSERT_RELATION( (minus
<_0
,_10
>::value
), ==, -10 );
29 MPL_ASSERT_RELATION( (minus
<_10
,_0
>::value
), ==, 10 );
31 MPL_ASSERT_RELATION( (times
<_1
,_10
>::value
), ==, 10 );
32 MPL_ASSERT_RELATION( (times
<_10
,_1
>::value
), ==, 10 );
33 MPL_ASSERT_RELATION( (multiplies
<_1
,_10
>::value
), ==, 10 );
34 MPL_ASSERT_RELATION( (multiplies
<_10
,_1
>::value
), ==, 10 );
36 MPL_ASSERT_RELATION( (divides
<_10
,_1
>::value
), ==, 10 );
37 MPL_ASSERT_RELATION( (divides
<_10
,_1
>::value
), ==, 10 );
39 MPL_ASSERT_RELATION( (modulus
<_10
,_1
>::value
), ==, 0 );
40 MPL_ASSERT_RELATION( (modulus
<_10
,_3
>::value
), ==, 1 );
42 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
43 MPL_ASSERT_RELATION( (minus
<_10
,_1
,_10
>::value
), ==, -1 );
44 MPL_ASSERT_RELATION( (plus
<_10
,_1
,_10
>::value
), ==, 21 );
45 MPL_ASSERT_RELATION( (divides
<_10
,_1
,_10
>::value
), ==, 1 );
46 MPL_ASSERT_RELATION( (divides
<_10
,_1
,_10
>::value
), ==, 1 );
49 MPL_ASSERT_RELATION( negate
<_10
>::value
, ==, -10 );