2 // (C) Copyright Steve Cleary, Beman Dawes, Howard 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).
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
9 #ifndef BOOST_TT_IS_POD_HPP_INCLUDED
10 #define BOOST_TT_IS_POD_HPP_INCLUDED
12 #include <cstddef> // size_t
13 #include <boost/type_traits/detail/config.hpp>
14 #include <boost/type_traits/is_void.hpp>
15 #include <boost/type_traits/is_scalar.hpp>
16 #include <boost/type_traits/intrinsics.hpp>
19 #include <boost/type_traits/is_function.hpp>
25 #define BOOST_INTERNAL_IS_POD(T) false
27 #define BOOST_INTERNAL_IS_POD(T) BOOST_IS_POD(T)
32 // forward declaration, needed by 'is_pod_array_helper' template below
33 template< typename T > struct is_POD;
35 template <typename T> struct is_pod
36 : public integral_constant<bool, ::boost::is_scalar<T>::value || ::boost::is_void<T>::value || BOOST_INTERNAL_IS_POD(T)>
39 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
40 template <typename T, std::size_t sz> struct is_pod<T[sz]> : public is_pod<T>{};
44 // the following help compilers without partial specialization support:
45 template<> struct is_pod<void> : public true_type{};
47 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
48 template<> struct is_pod<void const> : public true_type{};
49 template<> struct is_pod<void const volatile> : public true_type{};
50 template<> struct is_pod<void volatile> : public true_type{};
53 template<class T> struct is_POD : public is_pod<T>{};
57 #undef BOOST_INTERNAL_IS_POD
59 #endif // BOOST_TT_IS_POD_HPP_INCLUDED