is_same.hpp 793 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
  2. #define BOOST_CORE_IS_SAME_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // is_same<T1,T2>::value is true when T1 == T2
  8. //
  9. // Copyright 2014 Peter Dimov
  10. //
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt
  14. #include <boost/config.hpp>
  15. namespace boost
  16. {
  17. namespace core
  18. {
  19. template< class T1, class T2 > struct is_same
  20. {
  21. BOOST_STATIC_CONSTANT( bool, value = false );
  22. };
  23. template< class T > struct is_same< T, T >
  24. {
  25. BOOST_STATIC_CONSTANT( bool, value = true );
  26. };
  27. } // namespace core
  28. } // namespace boost
  29. #endif // #ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED