Fix some typo and bugs
authorkhizmax <libcds.dev@gmail.com>
Thu, 30 Oct 2014 19:58:17 +0000 (22:58 +0300)
committerkhizmax <libcds.dev@gmail.com>
Thu, 30 Oct 2014 19:58:17 +0000 (22:58 +0300)
cds/container/michael_map_nogc.h
tests/unit/map2/map_defs.h
tests/unit/map2/map_types.h
tests/unit/pqueue/pqueue_defs.h
tests/unit/pqueue/pqueue_type.h
tests/unit/set2/set_types.h

index be6013a1edfd951334954c1b30d1e99029612700..fbeb044eee6d5e451318cd1501826be768c3e3f5 100644 (file)
@@ -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 C>
-            bool operator ==(iterator_type<C> const& i )
+            bool operator ==(iterator_type<C> const& i ) const
             {
                 return base_class::operator ==( i );
             }
             /// Equality operator
             template <bool C>
-            bool operator !=(iterator_type<C> const& i )
+            bool operator !=(iterator_type<C> const& i ) const
             {
                 return !( *this == i );
             }
+
+            /// Checks if the iterator is not equal to \p end()
+            explicit operator bool() const
+            {
+                return *this != iterator_type();
+            }
         };
 
 
index bc8585a2b5fe2731ed2e3034cd9deb3bad6d17d5..0e949503796bd7d2ad0bedd3c91c17e1b9ced7be 100644 (file)
     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)\
     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)\
index 82dc9cc0273d99b8516c69249933d2cf41a70405..734c35d9d57da3272999ee5334730f27a691d3c0 100644 (file)
@@ -483,7 +483,7 @@ namespace map2 {
         struct traits_MichaelSet_michaelAlloc :
             public traits_MichaelMap_hash
         {
-            typedef cds::memory::MichaelAllocator<int> allocator;
+            typedef memory::MichaelAllocator<int> 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;
index 405a124ff91a4aa081ef62ce16ecde99ba2e1734..845ad4edf981dedd983f5c6bf5f3984e8a0d90b5 100644 (file)
     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)     \
     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)  \
index c5db84a9cf7884676154d35f75e8fe1d6e567519..803aad848d38ad7a4e2156e76cef13f43f19d875 100644 (file)
@@ -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<Value> >
-            >::type
-        > SkipList_HRC_max;
-
-        typedef SkipListPQueue< cds::gc::HRC, Value,
-            typename cc::skip_list::make_traits<
-                cc::opt::less< std::greater<Value> >
-            >::type, false
-        > SkipList_HRC_min;
 
         typedef SkipListPQueue< cds::gc::DHP, Value,
             typename cc::skip_list::make_traits<
index c8ae5d1784bc8dc9feaff08452ff23885ef66368..0e38346516bd5f0608c25d6aba0d0f4e7892eb0c 100644 (file)
@@ -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;