identity.cpp 826 B

1234567891011121314151617181920212223242526272829303132
  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/apply.hpp>
  12. #include <boost/mpl/identity.hpp>
  13. #include <boost/mpl/aux_/test.hpp>
  14. MPL_TEST_CASE()
  15. {
  16. typedef apply1< identity<>, char >::type t1;
  17. typedef apply1< identity<_1>, int >::type t2;
  18. MPL_ASSERT(( is_same< t1, char > ));
  19. MPL_ASSERT(( is_same< t2, int > ));
  20. }
  21. MPL_TEST_CASE()
  22. {
  23. typedef apply1< make_identity<>, char >::type t1;
  24. typedef apply1< make_identity<_1>, int >::type t2;
  25. MPL_ASSERT(( is_same< t1, identity<char> > ));
  26. MPL_ASSERT(( is_same< t2, identity<int> > ));
  27. }