1
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).
6//
7// See http://www.boost.org/libs/type_traits for most recent version including documentation.
8
9#ifndef BOOST_TT_IS_POD_HPP_INCLUDED
10#define BOOST_TT_IS_POD_HPP_INCLUDED
11
12#include <boost/type_traits/detail/config.hpp>
13#include <boost/type_traits/is_void.hpp>
14#include <boost/type_traits/is_scalar.hpp>
15#include <boost/type_traits/intrinsics.hpp>
16
17#ifdef __SUNPRO_CC
18#include <boost/type_traits/is_function.hpp>
19#endif
20
21#include <cstddef>
22
23#ifndef BOOST_IS_POD
24#define BOOST_INTERNAL_IS_POD(T) false
25#else
26#define BOOST_INTERNAL_IS_POD(T) BOOST_IS_POD(T)
27#endif
28
29namespace boost {
30
31// forward declaration, needed by 'is_pod_array_helper' template below
32template< typename T > struct is_POD;
33
34template <typename T> struct is_pod
35: public integral_constant<bool, ::boost::is_scalar<T>::value || ::boost::is_void<T>::value || BOOST_INTERNAL_IS_POD(T)>
36{};
37
38#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
39template <typename T, std::size_t sz> struct is_pod<T[sz]> : public is_pod<T>{};
40#endif
41
42
43// the following help compilers without partial specialization support:
44template<> struct is_pod<void> : public true_type{};
45
46#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
47template<> struct is_pod<void const> : public true_type{};
48template<> struct is_pod<void const volatile> : public true_type{};
49template<> struct is_pod<void volatile> : public true_type{};
50#endif
51
52template<class T> struct is_POD : public is_pod<T>{};
53
54} // namespace boost
55
56#undef BOOST_INTERNAL_IS_POD
57
58#endif // BOOST_TT_IS_POD_HPP_INCLUDED
59

source code of boost/boost/type_traits/is_pod.hpp