forked from boostorg/utility
Merge with the offending files removed.
[SVN r39995]
This commit is contained in:
@ -54,8 +54,8 @@ public:
|
||||
|
||||
void* apply (void* address, std::size_t n) const
|
||||
{
|
||||
for(char* next = address = this->apply(address); !! --n;)
|
||||
this->apply(next = next+sizeof(T));
|
||||
for(void* next = address = this->apply(address); !! --n;)
|
||||
this->apply(next = static_cast<char *>(next) + sizeof(T));
|
||||
return address;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,11 @@ class const_T_base
|
||||
new (&x) T();
|
||||
}
|
||||
|
||||
~const_T_base() { get().T::~T(); }
|
||||
~const_T_base()
|
||||
{
|
||||
void const * ptr = &x;
|
||||
static_cast<T*>(ptr)->T::~T();
|
||||
}
|
||||
|
||||
T & get() const
|
||||
{
|
||||
@ -69,7 +73,11 @@ class non_const_T_base
|
||||
new (&x) T();
|
||||
}
|
||||
|
||||
~non_const_T_base() { get().T::~T(); }
|
||||
~non_const_T_base()
|
||||
{
|
||||
void * ptr = &x;
|
||||
static_cast<T*>(ptr)->T::~T();
|
||||
}
|
||||
|
||||
T & get() const
|
||||
{
|
||||
|
@ -95,6 +95,9 @@ int test_main(int, char **)
|
||||
test( POD(0,0,0.0), POD('a',1234,56.78) ) ;
|
||||
test( NonPOD( std::string() ), NonPOD( std::string("something") ) ) ;
|
||||
|
||||
NonPOD NonPOD_object( std::string("NonPOD_object") );
|
||||
test<NonPOD *>( 0, &NonPOD_object ) ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user