summaryrefslogtreecommitdiff
path: root/boost/type_traits/is_pod.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/type_traits/is_pod.hpp')
-rw-r--r--boost/type_traits/is_pod.hpp49
1 files changed, 14 insertions, 35 deletions
diff --git a/boost/type_traits/is_pod.hpp b/boost/type_traits/is_pod.hpp
index 820a3ceeb9..9204c93e25 100644
--- a/boost/type_traits/is_pod.hpp
+++ b/boost/type_traits/is_pod.hpp
@@ -9,16 +9,16 @@
#ifndef BOOST_TT_IS_POD_HPP_INCLUDED
#define BOOST_TT_IS_POD_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_scalar.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/intrinsics.hpp>
-#include <cstddef>
+#ifdef __SUNPRO_CC
+#include <boost/type_traits/is_function.hpp>
+#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <cstddef>
#ifndef BOOST_IS_POD
#define BOOST_INTERNAL_IS_POD(T) false
@@ -31,49 +31,28 @@ namespace boost {
// forward declaration, needed by 'is_pod_array_helper' template below
template< typename T > struct is_POD;
-namespace detail {
-
-
-template <typename T> struct is_pod_impl
-{
- BOOST_STATIC_CONSTANT(
- bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_scalar<T>::value,
- ::boost::is_void<T>::value,
- BOOST_INTERNAL_IS_POD(T)
- >::value));
-};
+template <typename T> struct is_pod
+: public integral_constant<bool, ::boost::is_scalar<T>::value || ::boost::is_void<T>::value || BOOST_INTERNAL_IS_POD(T)>
+{};
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-template <typename T, std::size_t sz>
-struct is_pod_impl<T[sz]>
- : public is_pod_impl<T>
-{
-};
+template <typename T, std::size_t sz> struct is_pod<T[sz]> : public is_pod<T>{};
#endif
// the following help compilers without partial specialization support:
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void,true)
+template<> struct is_pod<void> : public true_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const volatile,true)
+template<> struct is_pod<void const> : public true_type{};
+template<> struct is_pod<void const volatile> : public true_type{};
+template<> struct is_pod<void volatile> : public true_type{};
#endif
-} // namespace detail
-
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl<T>::value)
-// is_POD is the old depricated name for this trait, do not use this as it may
-// be removed in future without warning!!
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::is_pod<T>::value)
+template<class T> struct is_POD : public is_pod<T>{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#undef BOOST_INTERNAL_IS_POD
#endif // BOOST_TT_IS_POD_HPP_INCLUDED