Stress tests: removed command line parameter --detail-level and envvar CDSTEST_DETAIL...
[libcds.git] / test / stress / set / set_type_feldman_hashset.h
index 7b074c779601dd42ecac17250a93c483d6ea056b..d5af2587ccce6156f019e5726d9b435fa47d8948 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:
 
@@ -63,6 +63,11 @@ namespace set {
         typedef typename T::hasher hasher;
         typedef typename get_extracted_ptr<GC>::extracted_ptr extracted_ptr;
 
+        template <typename OtherTraits>
+        struct rebind_traits {
+            typedef FeldmanHashSet<GC, T, OtherTraits > result;
+        };
+
         template <class Config>
         FeldmanHashSet( Config const& cfg )
             : base_class( cfg.s_nFeldmanSet_HeadBits, cfg.s_nFeldmanSet_ArrayBits )
@@ -83,13 +88,13 @@ namespace set {
         template <typename Q>
         extracted_ptr extract(Q const& key)
         {
-            return base_class::extract( hasher()(key) );
+            return base_class::extract( hasher()(key));
         }
 
         template <typename Q>
         bool contains( Q const& key )
         {
-            return base_class::contains( hasher()(key) );
+            return base_class::contains( hasher()(key));
         }
 
         // for testing
@@ -251,11 +256,11 @@ namespace set {
             {
                 typedef typename set_type_base< Key, Val >::key_val base_class;
 
-                /*explicit*/ key_val(key_type const& k) : base_class(k) {}
+                explicit key_val(key_type const& k) : base_class(k) {}
                 key_val(key_type const& k, value_type const& v) : base_class(k, v) {}
 
                 template <typename K>
-                /*explicit*/ key_val(K const& k) : base_class(k) {}
+                explicit key_val(K const& k) : base_class(k) {}
 
                 template <typename K, typename T>
                 key_val(K const& k, T const& v) : base_class(k, v) {}
@@ -267,17 +272,34 @@ namespace set {
                     {
                         return key_type( k );
                     }
+
+                    key_type const& operator()( key_val const& kv ) const
+                    {
+                        return kv.key;
+                    }
+
+                    key_type const& operator()( key_type const& k ) const
+                    {
+                        return k;
+                    }
                 };
             };
 
             struct traits : public cc::feldman_hashset::traits
             {
                 struct hash_accessor {
-                    key_type operator()(key_val const& kv)
+                    key_type const& operator()( key_val const& kv ) const
                     {
                         return kv.key;
                     }
+
+                    key_type const& operator()( key_type const& k ) const
+                    {
+                        return k;
+                    }
                 };
+
+                typedef set::cmp<Key>   compare;
             };
 
             struct traits_stat : public traits