mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Try to destruct values in a way that all compilers might like.
[SVN r51983]
This commit is contained in:
@ -223,11 +223,6 @@ namespace boost {
|
||||
functions func2_;
|
||||
functions_ptr func_; // The currently active functions.
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void destroy(T* x) {
|
||||
x->~T();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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_)
|
||||
|
Reference in New Issue
Block a user