From: khizmax Date: Thu, 30 Oct 2014 19:58:17 +0000 (+0300) Subject: Fix some typo and bugs X-Git-Tag: v2.0.0~159 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=2ecb5437f12edd8843990efcf0df132836e7d1f4 Fix some typo and bugs --- diff --git a/cds/container/michael_map_nogc.h b/cds/container/michael_map_nogc.h index be6013a1..fbeb044e 100644 --- a/cds/container/michael_map_nogc.h +++ b/cds/container/michael_map_nogc.h @@ -78,7 +78,6 @@ namespace cds { namespace container { //@endcond protected: - protected: /// Forward iterator /** \p IsConst - constness boolean flag @@ -169,16 +168,22 @@ namespace cds { namespace container { /// Equality operator template - bool operator ==(iterator_type const& i ) + bool operator ==(iterator_type const& i ) const { return base_class::operator ==( i ); } /// Equality operator template - bool operator !=(iterator_type const& i ) + bool operator !=(iterator_type const& i ) const { return !( *this == i ); } + + /// Checks if the iterator is not equal to \p end() + explicit operator bool() const + { + return *this != iterator_type(); + } }; diff --git a/tests/unit/map2/map_defs.h b/tests/unit/map2/map_defs.h index bc8585a2..0e949503 100644 --- a/tests/unit/map2/map_defs.h +++ b/tests/unit/map2/map_defs.h @@ -274,10 +274,6 @@ TEST_MAP_NOLF_EXTRACT(SkipListMap_hp_cmp_pascal_stat)\ TEST_MAP_NOLF_EXTRACT(SkipListMap_hp_less_xorshift)\ TEST_MAP_NOLF_EXTRACT(SkipListMap_hp_cmp_xorshift_stat)\ - TEST_MAP_NOLF_EXTRACT(SkipListMap_hrc_less_pascal)\ - TEST_MAP_NOLF_EXTRACT(SkipListMap_hrc_cmp_pascal_stat)\ - TEST_MAP_NOLF_EXTRACT(SkipListMap_hrc_less_xorshift)\ - TEST_MAP_NOLF_EXTRACT(SkipListMap_hrc_cmp_xorshift_stat)\ TEST_MAP_NOLF_EXTRACT(SkipListMap_ptb_less_pascal)\ TEST_MAP_NOLF_EXTRACT(SkipListMap_ptb_cmp_pascal_stat)\ TEST_MAP_NOLF_EXTRACT(SkipListMap_ptb_less_xorshift)\ @@ -302,10 +298,6 @@ CPPUNIT_TEST(SkipListMap_hp_cmp_pascal_stat)\ CPPUNIT_TEST(SkipListMap_hp_less_xorshift)\ CPPUNIT_TEST(SkipListMap_hp_cmp_xorshift_stat)\ - /*CPPUNIT_TEST(SkipListMap_hrc_less_pascal)*/\ - /*CPPUNIT_TEST(SkipListMap_hrc_cmp_pascal_stat)*/\ - /*CPPUNIT_TEST(SkipListMap_hrc_less_xorshift)*/\ - /*CPPUNIT_TEST(SkipListMap_hrc_cmp_xorshift_stat)*/\ CPPUNIT_TEST(SkipListMap_ptb_less_pascal)\ CPPUNIT_TEST(SkipListMap_ptb_cmp_pascal_stat)\ CPPUNIT_TEST(SkipListMap_ptb_less_xorshift)\ diff --git a/tests/unit/map2/map_types.h b/tests/unit/map2/map_types.h index 82dc9cc0..734c35d9 100644 --- a/tests/unit/map2/map_types.h +++ b/tests/unit/map2/map_types.h @@ -483,7 +483,7 @@ namespace map2 { struct traits_MichaelSet_michaelAlloc : public traits_MichaelMap_hash { - typedef cds::memory::MichaelAllocator allocator; + typedef memory::MichaelAllocator allocator; }; typedef cc::MichaelHashMap< cds::gc::HP, MichaelList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_HP_cmp_michaelAlloc; typedef cc::MichaelHashMap< cds::gc::DHP, MichaelList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_DHP_cmp_michaelAlloc; @@ -550,7 +550,7 @@ namespace map2 { {}; typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_HP_cmp_michaelAlloc; typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_DHP_cmp_michaelAlloc; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_NOGC _cmp_michaelAlloc; + typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_NOGC_cmp_michaelAlloc; typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPI_cmp_michaelAlloc; typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPB_cmp_michaelAlloc; typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPT_cmp_michaelAlloc; diff --git a/tests/unit/pqueue/pqueue_defs.h b/tests/unit/pqueue/pqueue_defs.h index 405a124f..845ad4ed 100644 --- a/tests/unit/pqueue/pqueue_defs.h +++ b/tests/unit/pqueue/pqueue_defs.h @@ -113,8 +113,6 @@ TEST_CASE(SkipList_HP_max_stat) \ TEST_CASE(SkipList_HP_min) \ TEST_CASE(SkipList_HP_min_stat) \ - TEST_CASE(SkipList_HRC_max) \ - TEST_CASE(SkipList_HRC_min) \ TEST_CASE(SkipList_DHP_max) \ TEST_CASE(SkipList_DHP_min) \ TEST_CASE(SkipList_RCU_gpi_max) \ @@ -129,8 +127,6 @@ CPPUNIT_TEST(SkipList_HP_max_stat) \ CPPUNIT_TEST(SkipList_HP_min) \ CPPUNIT_TEST(SkipList_HP_min_stat) \ - /*CPPUNIT_TEST(SkipList_HRC_max)*/ \ - /*CPPUNIT_TEST(SkipList_HRC_min)*/ \ CPPUNIT_TEST(SkipList_DHP_max) \ CPPUNIT_TEST(SkipList_DHP_min) \ CPPUNIT_TEST(SkipList_RCU_gpi_max) \ diff --git a/tests/unit/pqueue/pqueue_type.h b/tests/unit/pqueue/pqueue_type.h index c5db84a9..803aad84 100644 --- a/tests/unit/pqueue/pqueue_type.h +++ b/tests/unit/pqueue/pqueue_type.h @@ -326,17 +326,6 @@ namespace pqueue { >::type, false > SkipList_HP_min_stat; - typedef SkipListPQueue< cds::gc::HRC, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_HRC_max; - - typedef SkipListPQueue< cds::gc::HRC, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_HRC_min; typedef SkipListPQueue< cds::gc::DHP, Value, typename cc::skip_list::make_traits< diff --git a/tests/unit/set2/set_types.h b/tests/unit/set2/set_types.h index c8ae5d17..0e383465 100644 --- a/tests/unit/set2/set_types.h +++ b/tests/unit/set2/set_types.h @@ -326,7 +326,7 @@ namespace set2 { struct traits_MichaelList_cmp_stdAlloc_seqcst : public traits_MichaelList_cmp_stdAlloc { - typedef co::v::sequential_consistent > memory_model; + typedef co::v::sequential_consistent memory_model; }; typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_HP_cmp_stdAlloc_seqcst; typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_DHP_cmp_stdAlloc_seqcst;