Try to destruct values in a way that all compilers might like.

[SVN r51983]
This commit is contained in:
Daniel James
2009-03-26 07:00:46 +00:00
parent 3a8739cd60
commit 188bcafdec
2 changed files with 2 additions and 7 deletions

View File

@ -223,11 +223,6 @@ namespace boost {
functions func2_;
functions_ptr func_; // The currently active functions.
};
template <typename T>
void destroy(T* x) {
x->~T();
}
}
}

View File

@ -130,7 +130,7 @@ namespace boost {
void destroy(link_ptr ptr)
{
node* raw_ptr = static_cast<node*>(&*ptr);
boost::unordered_detail::destroy(&raw_ptr->value());
(&raw_ptr->value())->~value_type();
node_ptr n(node_alloc_.address(*raw_ptr));
node_alloc_.destroy(n);
node_alloc_.deallocate(n, 1);
@ -172,7 +172,7 @@ namespace boost {
{
if (node_) {
if (value_constructed_) {
boost::unordered_detail::destroy(&node_->value());
(&node_->value())->~value_type();
}
if (node_constructed_)