forked from boostorg/intrusive
Fixed errors when running MSVC x64 tests.
This commit is contained in:
1 parent
e2deea0630
commit
ebdea17f28
8 files changed
+67
-281
No files matched your search
@@ -250,33 +250,21 @@ class circular_slist_algorithms
|
||||
{
|
||||
if (other_node == this_node)
|
||||
return;
|
||||
bool this_inited = base_t::inited(this_node);
|
||||
bool other_inited = base_t::inited(other_node);
|
||||
if(this_inited){
|
||||
base_t::init_header(this_node);
|
||||
}
|
||||
if(other_inited){
|
||||
base_t::init_header(other_node);
|
||||
}
|
||||
const node_ptr this_next = NodeTraits::get_next(this_node);
|
||||
const node_ptr other_next = NodeTraits::get_next(other_node);
|
||||
const bool this_null = !this_next;
|
||||
const bool other_null = !other_next;
|
||||
const bool this_empty = this_next == this_node;
|
||||
const bool other_empty = other_next == other_node;
|
||||
|
||||
bool empty1 = base_t::unique(this_node);
|
||||
bool empty2 = base_t::unique(other_node);
|
||||
node_ptr prev_this (get_previous_node(this_node));
|
||||
node_ptr prev_other(get_previous_node(other_node));
|
||||
|
||||
node_ptr this_next (NodeTraits::get_next(this_node));
|
||||
node_ptr other_next(NodeTraits::get_next(other_node));
|
||||
NodeTraits::set_next(this_node, other_next);
|
||||
NodeTraits::set_next(other_node, this_next);
|
||||
NodeTraits::set_next(empty1 ? other_node : prev_this, other_node);
|
||||
NodeTraits::set_next(empty2 ? this_node : prev_other, this_node);
|
||||
|
||||
if(this_inited){
|
||||
base_t::init(other_node);
|
||||
if(!(other_null || other_empty)){
|
||||
NodeTraits::set_next(this_next == other_node ? other_node : get_previous_node(other_node), this_node );
|
||||
}
|
||||
if(other_inited){
|
||||
base_t::init(this_node);
|
||||
if(!(this_null | this_empty)){
|
||||
NodeTraits::set_next(other_next == this_node ? this_node : get_previous_node(this_node), other_node );
|
||||
}
|
||||
NodeTraits::set_next(this_node, other_empty ? this_node : (other_next == this_node ? other_node : other_next) );
|
||||
NodeTraits::set_next(other_node, this_empty ? other_node : (this_next == other_node ? this_node : this_next ) );
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Reverses the order of elements in the list.
|
||||
|
||||
@@ -43,9 +43,6 @@ class common_slist_algorithms
|
||||
return p;
|
||||
}
|
||||
|
||||
static void init_header(const node_ptr & this_node)
|
||||
{ NodeTraits::set_next(this_node, this_node); }
|
||||
|
||||
static void init(const node_ptr & this_node)
|
||||
{ NodeTraits::set_next(this_node, node_ptr()); }
|
||||
|
||||
|
||||
@@ -2711,15 +2711,16 @@ class hashtable_impl
|
||||
static std::size_t priv_stored_hash(slist_node_ptr n, detail::false_ false_value)
|
||||
{ return bucket_plus_vtraits<ValueTraits, BucketTraits>::priv_stored_hash(n, false_value); }
|
||||
|
||||
void priv_clear_buckets(bucket_ptr buckets_ptr, size_type bucket_cnt)
|
||||
void priv_clear_buckets(const bucket_ptr buckets_ptr, const size_type bucket_cnt)
|
||||
{
|
||||
for(; bucket_cnt--; ++buckets_ptr){
|
||||
bucket_ptr buckets_it = buckets_ptr;
|
||||
for(size_type bucket_i = 0; bucket_i != bucket_cnt; ++buckets_it, ++bucket_i){
|
||||
if(safemode_or_autounlink){
|
||||
bucket_plus_vtraits_t::priv_clear_group_nodes(*buckets_ptr, optimize_multikey_t());
|
||||
buckets_ptr->clear_and_dispose(detail::init_disposer<node_algorithms>());
|
||||
bucket_plus_vtraits_t::priv_clear_group_nodes(*buckets_it, optimize_multikey_t());
|
||||
buckets_it->clear_and_dispose(detail::init_disposer<node_algorithms>());
|
||||
}
|
||||
else{
|
||||
buckets_ptr->clear();
|
||||
buckets_it->clear();
|
||||
}
|
||||
}
|
||||
this->priv_initialize_cache();
|
||||
|
||||
@@ -159,10 +159,10 @@ struct pointer_traits
|
||||
|
||||
//priv_pointer_to
|
||||
static pointer priv_pointer_to(boost::true_type, typename boost::intrusive::detail::unvoid<element_type>::type& r)
|
||||
{ return Ptr::pointer_to(r); }
|
||||
{ return Ptr::pointer_to(r); }
|
||||
|
||||
static pointer priv_pointer_to(boost::false_type, typename boost::intrusive::detail::unvoid<element_type>::type& r)
|
||||
{ return pointer(boost::intrusive::detail::addressof(r)); }
|
||||
{ return pointer(boost::intrusive::detail::addressof(r)); }
|
||||
|
||||
//priv_static_cast_from
|
||||
template<class UPtr>
|
||||
@@ -189,7 +189,15 @@ struct pointer_traits
|
||||
|
||||
template<class UPtr>
|
||||
static pointer priv_dynamic_cast_from(boost::false_type, const UPtr &uptr)
|
||||
{ return pointer_to(*dynamic_cast<element_type*>(&*uptr)); }
|
||||
{
|
||||
element_type *p = dynamic_cast<element_type*>(&*uptr);
|
||||
if(!p){
|
||||
return pointer();
|
||||
}
|
||||
else{
|
||||
return pointer_to(*p);
|
||||
}
|
||||
}
|
||||
///@endcond
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user