Uses different pass count for different parallel queue test cases
[libcds.git] / cds / container / striped_map.h
index 88ca30dd6c7e3d07d068d4c10159ad3bd8b1f2cf..e2e412669d7ba2770df85ba5f8cc7c8bd0dc6a12 100644 (file)
@@ -1,11 +1,11 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     Source code repo: http://github.com/khizmax/libcds/
     Download: http://sourceforge.net/projects/libcds/files/
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:
 
@@ -25,7 +25,7 @@
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #ifndef CDSLIB_CONTAINER_STRIPED_MAP_H
@@ -241,7 +241,7 @@ namespace cds { namespace container {
                         #include <cds/container/striped_map/boost_map.h>
                         #include <cds/container/striped_hash_map.h>
                         typedef cds::container::StripedMap<
-                            boost::container::map< Key, T, std::pair< const Key, T> >
+                            boost::container::map< Key, T, std::less<Key> >
                         > striped_map;
                     \endcode
                     </td>
@@ -256,7 +256,7 @@ namespace cds { namespace container {
                         #include <cds/container/striped_hash_map.h>
                         typedef cds::container::StripedMap<
                             boost::container::flat_map< Key, T,
-                                std::less< std::pair< const Key, T> >
+                                std::less< std::less<Key> >
                             >
                         > striped_map;
                     \endcode
@@ -286,7 +286,7 @@ namespace cds { namespace container {
             There are two possibility:
             - either your \p MyBestContainer class has native support of bucket's interface;
                 in this case, you can use default <tt>striped_set::adapt</tt> metafunction;
-            - or your \p MyBestContainer class does not support bucket's interface, which means, that you should develop a specialization
+            - or your \p MyBestContainer class does not support bucket's interface; it means you should develop a specialization
                 <tt>cds::container::striped_set::adapt<MyBestContainer> </tt> metafunction providing necessary interface.
 
             The <tt>striped_set::adapt< Container, Options... ></tt> metafunction has two template argument:
@@ -295,7 +295,7 @@ namespace cds { namespace container {
                 any option from \p Options for its internal use. For example, a \p compare option can be passed to \p adapt
                 metafunction via \p Options argument of \p %StripedMap declaration.
 
-            See striped_set::adapt metafunction for the description of interface that the bucket container must provide
+            See \p striped_set::adapt metafunction for the description of interface that the bucket container must provide
             to be \p %StripedMap compatible.
 
         <b>Copy policy</b>
@@ -339,7 +339,7 @@ namespace cds { namespace container {
                                 std::list<std::pair<const Key, T> >::iterator itInsert,
                                 std::list<std::pair<const Key, T> >::iterator itWhat )
                             {
-                                std::pair<Key, T> newVal( itWhat->first, T() );
+                                std::pair<Key, T> newVal( itWhat->first, T());
                                 std::swap( list.insert( itInsert, newVal )->second, itWhat->second );
                             }
                         } \endcode
@@ -351,7 +351,7 @@ namespace cds { namespace container {
                                 std::list<std::pair<const Key, T> >::iterator itInsert,
                                 std::list<std::pair<const Key, T> >::iterator itWhat )
                             {
-                                list.insert( itInsert, std::move( *itWhat ) );
+                                list.insert( itInsert, std::move( *itWhat ));
                             }
                         } \endcode
                     </td>
@@ -378,7 +378,7 @@ namespace cds { namespace container {
                             {
                                 std::swap(
                                     map.insert(
-                                        std::map::value_type( itWhat->first, T() ) ).first->second
+                                        std::map::value_type( itWhat->first, T())).first->second
                                         , itWhat->second
                                 ));
                             }
@@ -414,7 +414,7 @@ namespace cds { namespace container {
                                 bc::slist<std::pair<const Key, T> >::iterator itInsert,
                                 bc::slist<std::pair<const Key, T> >::iterator itWhat )
                             {
-                                std::pair<Key, T> newVal( itWhat->first, T() );
+                                std::pair<Key, T> newVal( itWhat->first, T());
                                 std::swap( list.insert( itInsert, newVal )->second, itWhat->second );
                             }
                         } \endcode
@@ -426,7 +426,7 @@ namespace cds { namespace container {
                                 bc::slist<std::pair<const Key, T> >::iterator itInsert,
                                 bc::slist<std::pair<const Key, T> >::iterator itWhat )
                             {
-                                list.insert_after( itInsert, std::move( *itWhat ) );
+                                list.insert_after( itInsert, std::move( *itWhat ));
                             }
                         } \endcode
                     </td>
@@ -566,7 +566,7 @@ template <class Container, typename... Options>
         StripedMap(
             size_t nCapacity    ///< Initial size of bucket table and lock array. Must be power of two, the minimum is 16.
             ,resizing_policy&& resizingPolicy  ///< Resizing policy
-            ) : base_class( nCapacity, std::forward<resizing_policy>(resizingPolicy) )
+            ) : base_class( nCapacity, std::forward<resizing_policy>(resizingPolicy))
         {}
 
         /// Destructor destroys internal data
@@ -681,7 +681,7 @@ template <class Container, typename... Options>
             - \p bNew - \p true if the item has been inserted, \p false otherwise
             - \p item - item of the map
 
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
+            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successful,
             \p second is true if new item has been added or \p false if the item with \p key
             already is in the map.
         */
@@ -858,7 +858,7 @@ template <class Container, typename... Options>
         bool contains( K const& key, Less pred )
         {
             CDS_UNUSED( pred );
-            return base_class::contains( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >() );
+            return base_class::contains( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >());
         }
         //@cond
         template <typename K, typename Less