if.cpp 739 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/if.hpp>
  12. #include <boost/mpl/bool.hpp>
  13. #include <boost/mpl/aux_/test.hpp>
  14. MPL_TEST_CASE()
  15. {
  16. typedef if_<true_,char,long>::type t1;
  17. typedef if_c<true,char,long>::type t2;
  18. typedef if_<false_,char,long>::type t3;
  19. typedef if_c<false,char,long>::type t4;
  20. MPL_ASSERT(( is_same<t1, char> ));
  21. MPL_ASSERT(( is_same<t2, char> ));
  22. MPL_ASSERT(( is_same<t3, long> ));
  23. MPL_ASSERT(( is_same<t4, long> ));
  24. }