Uses different pass count for different parallel queue test cases
[libcds.git] / test / stress / pqueue / item.h
index 1a14fba18e586d6470384a56eb225c1404d56221..39f9d300d26ef4811b902b16d64695298ed1c35c 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 CDSSTRESS_PQUEUE_ITEM_H
@@ -50,63 +50,35 @@ namespace pqueue {
         {}
 
         simple_value( key_type n )
-            : key(n) 
+            : key(n)
         {}
-    };
-} // namespace pqueue
 
-namespace std {
-    template <class T> struct less;
-    template <class T> struct greater;
-
-    template <>
-    struct less<pqueue::simple_value>
-    {
-        bool operator()( pqueue::simple_value const& k1, pqueue::simple_value const& k2 ) const
+        friend bool operator <( simple_value const& lhs, simple_value const& rhs )
         {
-            return k1.key < k2.key;
+            return lhs.key < rhs.key;
         }
-
-        bool operator()( pqueue::simple_value const& k1, size_t k2 ) const
+        friend bool operator <( simple_value const& lhs, size_t rhs )
         {
-            return k1.key < k2;
+            return lhs.key < rhs;
         }
-
-        bool operator()( size_t k1, pqueue::simple_value const& k2 ) const
+        friend bool operator <( size_t lhs, simple_value const& rhs )
         {
-            return k1 < k2.key;
+            return lhs < rhs.key;
         }
 
-        bool operator()( size_t k1, size_t k2 ) const
+        friend bool operator >( simple_value const& lhs, simple_value const& rhs )
         {
-            return k1 < k2;
+            return lhs.key > rhs.key;
         }
-    };
-
-    template <>
-    struct greater<pqueue::simple_value>
-    {
-        bool operator()( pqueue::simple_value const& k1, pqueue::simple_value const& k2 ) const
+        friend bool operator >( simple_value const& lhs, size_t rhs )
         {
-            return k1.key > k2.key;
+            return lhs.key > rhs;
         }
-
-        bool operator()( pqueue::simple_value const& k1, size_t k2 ) const
+        friend bool operator >( size_t lhs, simple_value const& rhs )
         {
-            return k1.key > k2;
-        }
-
-        bool operator()( size_t k1, pqueue::simple_value const& k2 ) const
-        {
-            return k1 > k2.key;
-        }
-
-        bool operator()( size_t k1, size_t k2 ) const
-        {
-            return k1 > k2;
+            return lhs > rhs.key;
         }
     };
-
-} // namespace std
+} // namespace pqueue
 
 #endif // #ifndef CDSSTRESS_PQUEUE_ITEM_H