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:
John Maddock
2009-05-17 09:12:30 +00:00
parent 8d163a019e
commit bc45b934b6
3 changed files with 17 additions and 2 deletions

View File

@ -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

View File

@ -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(); }

View File

@ -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
}