is_union.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
  2. // Hinnant & John Maddock 2000.
  3. // Use, modification and distribution are subject to the Boost Software License,
  4. // Version 1.0. (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/type_traits for most recent version including documentation.
  8. #ifndef BOOST_TT_IS_UNION_HPP_INCLUDED
  9. #define BOOST_TT_IS_UNION_HPP_INCLUDED
  10. #include <boost/type_traits/intrinsics.hpp>
  11. #include <boost/type_traits/integral_constant.hpp>
  12. namespace boost {
  13. #ifdef BOOST_IS_UNION
  14. template <class T> struct is_union : public integral_constant<bool, BOOST_IS_UNION(T)> {};
  15. #else
  16. template <class T> struct is_union : public integral_constant<bool, false> {};
  17. #endif
  18. template <class T> struct is_union<T const> : public is_union<T>{};
  19. template <class T> struct is_union<T volatile const> : public is_union<T>{};
  20. template <class T> struct is_union<T volatile> : public is_union<T>{};
  21. } // namespace boost
  22. #endif // BOOST_TT_IS_UNION_HPP_INCLUDED