File indexing completed on 2025-01-18 09:50:38
0001
0002
0003
0004
0005 #ifndef REFERENT_STORAGE_DWA200278_HPP
0006 # define REFERENT_STORAGE_DWA200278_HPP
0007 # include <boost/mpl/if.hpp>
0008 # include <boost/type_traits/aligned_storage.hpp>
0009 # include <cstddef>
0010
0011 namespace boost { namespace python { namespace detail {
0012
0013 template <std::size_t size, std::size_t alignment = std::size_t(-1)>
0014 struct aligned_storage
0015 {
0016 union type
0017 {
0018 typename ::boost::aligned_storage<size, alignment>::type data;
0019 char bytes[size];
0020 };
0021 };
0022
0023
0024
0025 template <class T> struct referent_size;
0026
0027
0028 template <class T>
0029 struct referent_size<T&>
0030 {
0031 BOOST_STATIC_CONSTANT(
0032 std::size_t, value = sizeof(T));
0033 };
0034
0035
0036
0037 template <class T>
0038 struct referent_storage
0039 {
0040 typedef typename aligned_storage<referent_size<T>::value, alignment_of<T>::value>::type type;
0041 };
0042
0043 }}}
0044
0045 #endif