next.cpp 719 B

1234567891011121314151617181920212223242526272829
  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. //
  3. // Distributed under the Boost Software License,Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/next.hpp>
  12. #include <boost/mpl/prior.hpp>
  13. #include <boost/mpl/int.hpp>
  14. #include <boost/mpl/aux_/test.hpp>
  15. MPL_TEST_CASE()
  16. {
  17. typedef int_<0> _0;
  18. typedef int_<1> _1;
  19. typedef int_<2> _2;
  20. MPL_ASSERT(( is_same< next<_0>::type, _1 > ));
  21. MPL_ASSERT(( is_same< next<_1>::type, _2 > ));
  22. MPL_ASSERT(( is_same< prior<_1>::type, _0 > ));
  23. MPL_ASSERT(( is_same< prior<_2>::type, _1 > ));
  24. }