static_assert_same.hpp 617 B

1234567891011121314151617181920
  1. // Copyright David Abrahams 2003.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef STATIC_ASSERT_SAME_DWA2003530_HPP
  6. # define STATIC_ASSERT_SAME_DWA2003530_HPP
  7. #include <boost/mpl/assert.hpp>
  8. # include <boost/type_traits/is_same.hpp>
  9. #define STATIC_ASSERT_SAME( T1,T2 ) BOOST_MPL_ASSERT((::boost::is_same< T1, T2 >))
  10. template <class T1, class T2>
  11. struct static_assert_same
  12. {
  13. BOOST_MPL_ASSERT((::boost::is_same< T1, T2 >));
  14. enum { value = 1 };
  15. };
  16. #endif // STATIC_ASSERT_SAME_DWA2003530_HPP