max_element.cpp 620 B

1234567891011121314151617181920212223242526
  1. // Copyright Eric Friedman 2002-2003
  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/max_element.hpp>
  12. #include <boost/mpl/list_c.hpp>
  13. #include <boost/mpl/aux_/test.hpp>
  14. MPL_TEST_CASE()
  15. {
  16. typedef list_c<int,3,4,2,0,-5,8,-1,7>::type numbers;
  17. typedef max_element< numbers >::type iter;
  18. typedef deref<iter>::type max_value;
  19. MPL_ASSERT_RELATION( max_value::value, ==, 8 );
  20. }