X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cds%2Fcontainer%2Fimpl%2Flazy_kvlist.h;h=5db39fc912feea0b8c326f3052e88e2918752f98;hb=ba2a5aa1155973b202518c6fb013c0fb84f0d9e6;hp=71401a2c4d01d4fb7221ac430aac0eb28f42e339;hpb=cd515d6402be81b84e2eb0c9d4cf0a1ca9e4d95a;p=libcds.git diff --git a/cds/container/impl/lazy_kvlist.h b/cds/container/impl/lazy_kvlist.h index 71401a2c..5db39fc9 100644 --- a/cds/container/impl/lazy_kvlist.h +++ b/cds/container/impl/lazy_kvlist.h @@ -134,6 +134,8 @@ namespace cds { namespace container { typedef typename maker::key_comparator key_comparator; ///< key comparing functor typedef typename base_class::memory_model memory_model; ///< Memory ordering. See \p cds::opt::memory_model + static CDS_CONSTEXPR const size_t c_nHazardPtrCount = base_class::c_nHazardPtrCount; ///< Count of hazard pointer required for the algorithm + protected: //@cond typedef typename base_class::value_type node_type; @@ -291,8 +293,7 @@ namespace cds { namespace container { - Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent deleting operations it is no guarantee that you iterate all item in the list. - Therefore, the use of iterators in concurrent environment is not good idea. Use the iterator on the concurrent container - for debug purpose only. + @warning Use this iterator on the concurrent container for debugging purpose only. The iterator interface to access item data: - operator -> - returns a pointer to \ref value_type for iterator @@ -310,6 +311,8 @@ namespace cds { namespace container { */ typedef iterator_type const_iterator; + ///@name Forward iterators (only for debugging purpose) + //@{ /// Returns a forward iterator addressing the first element in a list /** For empty list \code begin() == end() \endcode @@ -335,32 +338,33 @@ namespace cds { namespace container { } /// Returns a forward const iterator addressing the first element in a list - //@{ const_iterator begin() const { const_iterator it( head() ); ++it; // skip dummy head return it; } + + /// Returns a forward const iterator addressing the first element in a list const_iterator cbegin() const { const_iterator it( head() ); ++it; // skip dummy head return it; } - //@} /// Returns an const iterator that addresses the location succeeding the last element in a list - //@{ const_iterator end() const { return const_iterator( tail()); } + + /// Returns an const iterator that addresses the location succeeding the last element in a list const_iterator cend() const { return const_iterator( tail()); } - //@} + //@} public: /// Default constructor