From f165299dd0a838230eff674f8ca9969fd13560e5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 6 Dec 2003 23:27:28 +0000 Subject: [PATCH] - Revert to David A.'s code, that *almost* worked perfectly - Add partial specialization of is_pod for lower_alignment [SVN r21166] --- .../boost/type_traits/type_with_alignment.hpp | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp index 5a1c563..e7d2736 100644 --- a/include/boost/type_traits/type_with_alignment.hpp +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -144,15 +144,6 @@ union max_align ) }; -// All of the has_one_T types are POD types, so tell that to is_POD -# define BOOST_TT_HAS_ONE_T_POD(R,P,I,T) BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,T,true) -BOOST_PP_LIST_FOR_EACH_I( - BOOST_TT_HAS_ONE_T_POD - , ignored - , BOOST_TT_ALIGNMENT_STRUCT_TYPES - ) - -#undef BOOST_TT_HAS_ONE_T_POD #undef BOOST_TT_ALIGNMENT_BASE_TYPES #undef BOOST_TT_HAS_ONE_T #undef BOOST_TT_ALIGNMENT_STRUCT_TYPES @@ -168,8 +159,27 @@ struct is_aligned ); }; +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::max_align,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<1> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<2> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<4> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<8> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<10> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<16> ,true) +BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<32> ,true) +#endif + } // namespace detail +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct is_pod<::boost::detail::lower_alignment > +{ + BOOST_STATIC_CONSTANT(std::size_t, value = true); +}; +#endif + // This alignment method originally due to Brian Parker, implemented by David // Abrahams, and then ported here by Doug Gregor. template