forked from boostorg/type_traits
Return the address of the char[] array from aligned_storage::address
This commit is contained in:
1 parent
d2a4a6bf0a
commit
f541d1ac4d
1 file changed
+4
-5
@@ -42,21 +42,20 @@ struct aligned_storage_imp
|
||||
{
|
||||
union data_t
|
||||
{
|
||||
char buf[size_];
|
||||
|
||||
unsigned char buf[size_];
|
||||
typename ::boost::type_with_alignment<alignment_>::type align_;
|
||||
} data_;
|
||||
void* address() const { return const_cast<aligned_storage_imp*>(this); }
|
||||
void* address() const { return const_cast<unsigned char*>(data_.buf); }
|
||||
};
|
||||
template <std::size_t size>
|
||||
struct aligned_storage_imp<size, std::size_t(-1)>
|
||||
{
|
||||
union data_t
|
||||
{
|
||||
char buf[size];
|
||||
unsigned char buf[size];
|
||||
::boost::detail::max_align align_;
|
||||
} data_;
|
||||
void* address() const { return const_cast<aligned_storage_imp*>(this); }
|
||||
void* address() const { return const_cast<unsigned char*>(data_.buf); }
|
||||
};
|
||||
|
||||
template< std::size_t alignment_ >
|
||||
|
||||
Reference in new issue
Block a user