Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/test/comparison.cpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.5 KB
Line 
1
2// Copyright Aleksey Gurtovoy 2001-2004
3//
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)
7//
8// See http://www.boost.org/libs/mpl for documentation.
9
10// $Source: /cvsroot/boost/boost/libs/mpl/test/comparison.cpp,v $
11// $Date: 2004/09/02 15:41:35 $
12// $Revision: 1.5 $
13
14#include <boost/mpl/comparison.hpp>
15#include <boost/mpl/int.hpp>
16#include <boost/mpl/aux_/test.hpp>
17
18// make sure MSVC behaves nicely in presence of the following template
19template< typename T > struct value {};
20
21typedef int_<0> _0;
22typedef int_<10> _10;
23
24MPL_TEST_CASE()
25{
26    MPL_ASSERT_NOT(( equal_to<_0, _10> ));
27    MPL_ASSERT_NOT(( equal_to<_10, _0> ));
28    MPL_ASSERT(( equal_to<_10, _10> ));
29}
30
31MPL_TEST_CASE()
32{
33    MPL_ASSERT(( not_equal_to<_0, _10> ));
34    MPL_ASSERT(( not_equal_to<_10, _0> ));
35    MPL_ASSERT_NOT(( not_equal_to<_10, _10> ));
36}
37
38MPL_TEST_CASE()
39{
40    MPL_ASSERT(( less<_0, _10>  ));
41    MPL_ASSERT_NOT(( less<_10, _0> ));
42    MPL_ASSERT_NOT(( less<_10, _10> ));
43}
44
45MPL_TEST_CASE()
46{
47    MPL_ASSERT(( less_equal<_0, _10> ));
48    MPL_ASSERT_NOT(( less_equal<_10, _0> ));
49    MPL_ASSERT(( less_equal<_10, _10> ));
50}
51
52MPL_TEST_CASE()
53{
54    MPL_ASSERT(( greater<_10, _0> ));
55    MPL_ASSERT_NOT(( greater<_0, _10> ));
56    MPL_ASSERT_NOT(( greater<_10, _10> ));
57}
58
59MPL_TEST_CASE()
60{
61    MPL_ASSERT_NOT(( greater_equal<_0, _10> ));
62    MPL_ASSERT(( greater_equal<_10, _0> ));
63    MPL_ASSERT(( greater_equal<_10, _10> ));
64}
Note: See TracBrowser for help on using the repository browser.