is_same.hpp 795 B

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