| 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 |
|---|
| 19 | template< typename T > struct value {}; |
|---|
| 20 | |
|---|
| 21 | typedef int_<0> _0; |
|---|
| 22 | typedef int_<10> _10; |
|---|
| 23 | |
|---|
| 24 | MPL_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 | |
|---|
| 31 | MPL_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 | |
|---|
| 38 | MPL_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 | |
|---|
| 45 | MPL_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 | |
|---|
| 52 | MPL_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 | |
|---|
| 59 | MPL_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 | } |
|---|