blob: 7be09d944706d81958189c24236e97e920fb93d6 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001
2// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3// Hinnant & John Maddock 2000.
4// Use, modification and distribution are subject to the Boost Software License,
5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt).
7//
8// See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10
11#ifndef BOOST_TT_IS_UNION_HPP_INCLUDED
12#define BOOST_TT_IS_UNION_HPP_INCLUDED
13
Jeff Thompson2277ce52013-08-01 17:34:11 -070014#include <ndnboost/type_traits/remove_cv.hpp>
15#include <ndnboost/type_traits/config.hpp>
16#include <ndnboost/type_traits/intrinsics.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070017
18// should be the last #include
Jeff Thompson2277ce52013-08-01 17:34:11 -070019#include <ndnboost/type_traits/detail/bool_trait_def.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070020
21namespace ndnboost {
22
23namespace detail {
24#ifndef __GNUC__
25template <typename T> struct is_union_impl
26{
27 typedef typename remove_cv<T>::type cvt;
28#ifdef BOOST_IS_UNION
29 BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
30#else
31 BOOST_STATIC_CONSTANT(bool, value = false);
32#endif
33};
34#else
35//
36// using remove_cv here generates a whole load of needless
37// warnings with gcc, since it doesn't do any good with gcc
38// in any case (at least at present), just remove it:
39//
40template <typename T> struct is_union_impl
41{
42#ifdef BOOST_IS_UNION
43 BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
44#else
45 BOOST_STATIC_CONSTANT(bool, value = false);
46#endif
47};
48#endif
49} // namespace detail
50
51BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::ndnboost::detail::is_union_impl<T>::value)
52
53} // namespace ndnboost
54
Jeff Thompson2277ce52013-08-01 17:34:11 -070055#include <ndnboost/type_traits/detail/bool_trait_undef.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070056
57#endif // BOOST_TT_IS_UNION_HPP_INCLUDED