empty_sequence.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright Aleksey Gurtovoy 2004
  2. // Copyright Alexander Nasonov 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. // $Id$
  10. // $Date$
  11. // $Revision$
  12. #include <boost/mpl/empty_sequence.hpp>
  13. #include <boost/mpl/size.hpp>
  14. #include <boost/mpl/distance.hpp>
  15. #include <boost/mpl/advance.hpp>
  16. #include <boost/mpl/begin_end.hpp>
  17. #include <boost/mpl/equal.hpp>
  18. #include <boost/mpl/aux_/test.hpp>
  19. #include <boost/type_traits/is_same.hpp>
  20. #include <boost/type_traits/add_pointer.hpp>
  21. MPL_TEST_CASE()
  22. {
  23. typedef begin<empty_sequence>::type begin;
  24. typedef end<empty_sequence>::type end;
  25. MPL_ASSERT(( is_same<begin,end> ));
  26. MPL_ASSERT_RELATION( (mpl::distance<begin,end>::value), ==, 0 );
  27. MPL_ASSERT_RELATION( size<empty_sequence>::value, ==, 0 );
  28. typedef advance_c<begin,0>::type advanced;
  29. MPL_ASSERT(( is_same<advanced,end> ));
  30. MPL_ASSERT(( equal< empty_sequence, empty_sequence::type > ));
  31. }