pop_front.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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/pop_front.hpp>
  12. #include <boost/mpl/list.hpp>
  13. #include <boost/mpl/size.hpp>
  14. #include <boost/mpl/front.hpp>
  15. #include <boost/mpl/aux_/test.hpp>
  16. MPL_TEST_CASE()
  17. {
  18. typedef list<long>::type types1;
  19. typedef list<int,long>::type types2;
  20. typedef list<char,int,long>::type types3;
  21. typedef pop_front<types1>::type result1;
  22. typedef pop_front<types2>::type result2;
  23. typedef pop_front<types3>::type result3;
  24. MPL_ASSERT_RELATION( size<result1>::value, ==, 0 );
  25. MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
  26. MPL_ASSERT_RELATION( size<result3>::value, ==, 2 );
  27. MPL_ASSERT(( is_same< front<result2>::type, long > ));
  28. MPL_ASSERT(( is_same< front<result3>::type, int > ));
  29. }