mirror of
https://github.com/boostorg/type_traits.git
synced 2025-08-02 05:54:31 +02:00
Mode aligned_storage<>::type report true to is_pod.
[SVN r26960]
This commit is contained in:
@@ -10,23 +10,45 @@
|
||||
#define BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED
|
||||
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
|
||||
// should be the last #include
|
||||
#include "boost/type_traits/detail/bool_trait_def.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T, std::size_t N>
|
||||
struct storage
|
||||
{
|
||||
union
|
||||
{
|
||||
char m_buf[N];
|
||||
T m_align;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <class T, std::size_t K>
|
||||
struct is_pod<boost::detail::storage<T,K> >
|
||||
BOOST_TT_AUX_BOOL_C_BASE(true)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
|
||||
};
|
||||
#endif
|
||||
|
||||
template <std::size_t Len, std::size_t Align>
|
||||
struct aligned_storage
|
||||
{
|
||||
typedef typename type_with_alignment<Align>::type aligned_type;
|
||||
struct type{
|
||||
union
|
||||
{
|
||||
char m_buf[Len];
|
||||
aligned_type m_align;
|
||||
};
|
||||
};
|
||||
typedef typename type_with_alignment<Align>::type aligned_type;
|
||||
typedef detail::storage<aligned_type,Len> type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include "boost/type_traits/detail/bool_trait_undef.hpp"
|
||||
|
||||
#endif // BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user