forked from boostorg/type_traits
Added tests for aligned_storage::address() and fixed some Borland specific bugs (these show up in serialization/test/test_delete_pointer_binary_archive).
[SVN r53071]
This commit is contained in:
@ -70,7 +70,13 @@ template <
|
||||
std::size_t size_
|
||||
, std::size_t alignment_ = std::size_t(-1)
|
||||
>
|
||||
class aligned_storage : private detail::aligned_storage::aligned_storage_imp<size_, alignment_>
|
||||
class aligned_storage :
|
||||
#ifndef __BORLANDC__
|
||||
private
|
||||
#else
|
||||
public
|
||||
#endif
|
||||
detail::aligned_storage::aligned_storage_imp<size_, alignment_>
|
||||
{
|
||||
|
||||
public: // constants
|
||||
|
@ -26,7 +26,13 @@ namespace
|
||||
};
|
||||
|
||||
template< unsigned N, unsigned Alignment >
|
||||
struct alignment_implementation2 : private boost::detail::aligned_storage::aligned_storage_imp<N,Alignment>
|
||||
struct alignment_implementation2 :
|
||||
#ifndef __BORLANDC__
|
||||
private
|
||||
#else
|
||||
public
|
||||
#endif
|
||||
boost::detail::aligned_storage::aligned_storage_imp<N,Alignment>
|
||||
{
|
||||
typedef boost::detail::aligned_storage::aligned_storage_imp<N,Alignment> type;
|
||||
const void* address() const { return static_cast<const type*>(this)->address(); }
|
||||
|
@ -66,6 +66,9 @@ void check(const T&)
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
BOOST_CHECK(::tt::is_pod<t3>::value == true);
|
||||
#endif
|
||||
BOOST_CHECK(as3.address() == &as3);
|
||||
const t3 as4 = { 0, };
|
||||
BOOST_CHECK(as4.address() == static_cast<const void*>(&as4));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user