Remove CDS_CXX11_LAMBDA_SUPPORT macro and a lot of emulating code
authorkhizmax <khizmax@gmail.com>
Wed, 24 Sep 2014 11:29:49 +0000 (15:29 +0400)
committerkhizmax <khizmax@gmail.com>
Wed, 24 Sep 2014 11:29:49 +0000 (15:29 +0400)
58 files changed:
cds/compiler/clang/defs.h
cds/compiler/defs.h
cds/compiler/gcc/defs.h
cds/compiler/icl/defs.h
cds/compiler/vc/defs.h
cds/container/cuckoo_map.h
cds/container/cuckoo_set.h
cds/container/ellen_bintree_map_impl.h
cds/container/ellen_bintree_map_rcu.h
cds/container/ellen_bintree_set_impl.h
cds/container/ellen_bintree_set_rcu.h
cds/container/lazy_kvlist_impl.h
cds/container/lazy_kvlist_nogc.h
cds/container/lazy_kvlist_rcu.h
cds/container/lazy_list_impl.h
cds/container/lazy_list_nogc.h
cds/container/lazy_list_rcu.h
cds/container/michael_kvlist_impl.h
cds/container/michael_kvlist_nogc.h
cds/container/michael_kvlist_rcu.h
cds/container/michael_list_impl.h
cds/container/michael_list_nogc.h
cds/container/michael_list_rcu.h
cds/container/mspriority_queue.h
cds/container/skip_list_map_impl.h
cds/container/skip_list_map_rcu.h
cds/container/skip_list_set_impl.h
cds/container/skip_list_set_nogc.h
cds/container/skip_list_set_rcu.h
cds/container/split_list_map.h
cds/container/split_list_map_rcu.h
cds/container/split_list_set.h
cds/container/split_list_set_nogc.h
cds/container/split_list_set_rcu.h
cds/container/striped_map.h
cds/container/striped_set.h
cds/container/vyukov_mpmc_cycle_queue.h
cds/intrusive/cuckoo_set.h
cds/intrusive/ellen_bintree_impl.h
cds/intrusive/ellen_bintree_rcu.h
cds/intrusive/lazy_list_impl.h
cds/intrusive/lazy_list_rcu.h
cds/intrusive/michael_list_impl.h
cds/intrusive/michael_list_rcu.h
cds/intrusive/mspriority_queue.h
cds/intrusive/skip_list_impl.h
cds/intrusive/skip_list_nogc.h
cds/intrusive/skip_list_rcu.h
cds/intrusive/split_list.h
cds/intrusive/split_list_base.h
cds/intrusive/split_list_nogc.h
cds/intrusive/split_list_rcu.h
cds/intrusive/striped_set.h
cds/intrusive/striped_set/adapter.h
cds/intrusive/striped_set/boost_list.h
cds/intrusive/striped_set/boost_slist.h
cds/intrusive/striped_set/boost_unordered_set.h
cds/intrusive/treiber_stack.h

index 907577804942dd713769e4e4366e939f16d3cb7c..41e3e0f360a76b6a3ef5afdc7a09c0cbf684fe41 100644 (file)
@@ -28,9 +28,6 @@
 // C++11 inline namespace
 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
-// Lambda
-#define CDS_CXX11_LAMBDA_SUPPORT
-
 #define CDS_CONSTEXPR    constexpr
 #define CDS_CONSTEXPR_CONST constexpr const
 
index 95290eae31311688eaa3d2a2a5de6dcf63621aad..b61b29777b3d51b231140dc203139cdb32c7a839 100644 (file)
@@ -6,6 +6,7 @@
 /*
     Required C++11 features:
     - move semantics [CDS_RVALUE_SUPPORT, CDS_MOVE_SEMANTICS_SUPPORT]
+    - lambda function [CDS_CXX11_LAMBDA_SUPPORT]
     - variadic template [CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT]
     - template alias [CDS_CXX11_TEMPLATE_ALIAS_SUPPORT]
     - explicit conversion operator [CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT]
index de34765a6c55a9a067ba9d44d82c26de9333d0cb..37e6957554716668ea11b1aca95745ac4ed61029 100644 (file)
@@ -29,9 +29,6 @@
 // C++11 inline namespace
 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
-// Lambda
-#define CDS_CXX11_LAMBDA_SUPPORT
-
 // constexpr
 #define CDS_CONSTEXPR    constexpr
 
index 50c7e490e441abd1d7fe21bc98c65c5c28906827..9e6e9ec5d1560be401ecfdc4109099d72e24e99c 100644 (file)
@@ -84,9 +84,6 @@
 #define CDS_NOEXCEPT_SUPPORT        noexcept
 #define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
 
-// Lambda (ICL 12 +)
-#define CDS_CXX11_LAMBDA_SUPPORT
-
 // C++11 inline namespace
 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
index 84700abc53579bb7da09983c7bb420d63d431464..ff485b7c58780cd6e03382fc2a21db235ebcdeac 100644 (file)
@@ -87,9 +87,6 @@
 #define CDS_NOEXCEPT_SUPPORT
 #define CDS_NOEXCEPT_SUPPORT_(expr)
 
-// Lambda (VC 10 +)
-#define CDS_CXX11_LAMBDA_SUPPORT
-
 // C++11 inline namespace
 //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
index f9ae03c7a8fb5570346444bdfee40dbcb3976dda..c80c0e1f124520b88cb1b99dff2b9b97c5d79ea1 100644 (file)
@@ -374,71 +374,6 @@ namespace cds { namespace container {
 
         typedef std::unique_ptr< node_type, node_disposer >     scoped_node_ptr;
 
-#ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor
-        {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const & v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        template <typename Func>
-        class insert_key_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_key_wrapper( Func f ): base_class(f) {}
-
-            void operator()( node_type& item )
-            {
-                base_class::get()( item.m_val );
-            }
-        };
-
-        template <typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_wrapper( Func f) : base_class(f) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& )
-            {
-                base_class::get()( bNew, item.m_val );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_val, val );
-            }
-        };
-#endif  // #ifndef CDS_CXX11_LAMBDA_SUPPORT
-
         //@endcond
 
     public:
@@ -537,11 +472,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -558,12 +489,7 @@ namespace cds { namespace container {
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [&val](value_type& item) { item.second = val ; } );
-#       else
-            insert_value_functor<V> f(val);
-            return insert_key( key, cds::ref(f) );
-#       endif
         }
 
         /// Inserts new node and initialize it by a functor
@@ -598,13 +524,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( alloc_node( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_val ); } ))
-#       else
-            insert_key_wrapper<Func> wrapper(func);
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#endif
-            {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_val ); } )) {
                 pNode.release();
                 return true;
             }
@@ -661,14 +581,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             scoped_node_ptr pNode( alloc_node( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_val ); }
             );
-#       else
-            ensure_wrapper<Func> wrapper( func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -780,12 +695,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_val );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( key, cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -799,13 +709,8 @@ namespace cds { namespace container {
         template <typename K, typename Predicate, typename Func>
         bool find_with( K const& key, Predicate pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key, cds::details::predicate_wrapper<node_type, Predicate, key_accessor>(),
                 [&f](node_type& item, K const& ) { cds::unref(f)( item.m_val );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper<node_type, Predicate, key_accessor>(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p key
index 8c24b107ab922b479a1486c19c2429bf60119733..348f02dfb3b19ab842216d1826059a22d9ce135f 100644 (file)
@@ -419,62 +419,6 @@ namespace cds { namespace container {
 
         typedef std::unique_ptr< node_type, node_disposer >     scoped_node_ptr;
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( node_type& item, Q& val ) const
-            {}
-        };
-
-        template <typename Func>
-        class insert_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_wrapper( Func f ): base_class(f) {}
-
-            void operator()( node_type& node )
-            {
-                base_class::get()( node.m_val );
-            }
-        };
-
-        template <typename Q, typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            Q const&    val;
-
-            ensure_wrapper( Q const& v, Func f) : base_class(f), val(v) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& )
-            {
-                base_class::get()( bNew, item.m_val, val );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_val, val );
-            }
-        };
-#   endif
         //@endcond
 
     public:
@@ -573,11 +517,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool insert( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -603,13 +543,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr pNode( alloc_node( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&f]( node_type& node ) { cds::unref(f)( node.m_val ); } ))
-#       else
-            insert_wrapper<Func> wrapper( f );
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert( *pNode, [&f]( node_type& node ) { cds::unref(f)( node.m_val ); } )) {
                 pNode.release();
                 return true;
             }
@@ -665,14 +599,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( Q const& val, Func func )
         {
             scoped_node_ptr pNode( alloc_node( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&val,&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_val, val ); }
             );
-#       else
-            ensure_wrapper<Q, Func> wrapper( val, func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -792,12 +721,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f](node_type& item, Q& v) { cds::unref(f)( item.m_val, v );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -811,13 +735,8 @@ namespace cds { namespace container {
         template <typename Q, typename Predicate, typename Func>
         bool find_with( Q& val, Predicate pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(),
                 [&f](node_type& item, Q& v) { cds::unref(f)( item.m_val, v );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p val
@@ -844,12 +763,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f](node_type& item, Q const& v) { cds::unref(f)( item.m_val, v );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -863,13 +777,8 @@ namespace cds { namespace container {
         template <typename Q, typename Predicate, typename Func>
         bool find_with( Q const& val, Predicate pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(),
                 [&f](node_type& item, Q const& v) { cds::unref(f)( item.m_val, v );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p val
@@ -884,11 +793,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool find( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [](node_type&, Q const&) {});
-#       else
-            return base_class::find( val, empty_find_functor());
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -902,11 +807,7 @@ namespace cds { namespace container {
         template <typename Q, typename Predicate>
         bool find_with( Q const& val, Predicate pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(), [](node_type&, Q const&) {});
-#       else
-            return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(), empty_find_functor());
-#       endif
         }
 
         /// Clears the set
index a71b7857b68dc06a4ec496f613fa9b736415b7fb..8fe59da1151a3f64ca76fbde2a3b5ff62169cd6f 100644 (file)
@@ -143,89 +143,6 @@ namespace cds { namespace container {
         /// Guarded pointer
         typedef cds::gc::guarded_ptr< gc, leaf_node, value_type, details::guarded_ptr_cast_set<leaf_node, value_type> > guarded_ptr;
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor
-        {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const& v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        template <typename Func>
-        class insert_key_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_key_wrapper( Func f ): base_class(f) {}
-
-            void operator()( leaf_node& item )
-            {
-                base_class::get()( item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_wrapper( Func f) : base_class(f) {}
-
-            void operator()( bool bNew, leaf_node& item, leaf_node const& )
-            {
-                base_class::get()( bNew, item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( leaf_node& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-#   endif
-        //@endcond
-
     public:
         /// Default constructor
         EllenBinTreeMap()
@@ -252,11 +169,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -314,13 +227,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } ))
-#       else
-            insert_key_wrapper<Func> wrapper(func);
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#endif
-            {
+            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -377,14 +284,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&func](bool bNew, leaf_node& item, leaf_node const& ){ cds::unref(func)( bNew, item.m_Value ); }
             );
-#       else
-            ensure_wrapper<Func> wrapper( func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -433,12 +335,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -451,13 +348,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool erase_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
                 [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts an item with minimal key from the map
@@ -549,12 +441,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( key, cds::ref(wrapper) );
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -567,13 +454,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
                 [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p key
index 4bab281a6f74c0b3770c7bc292aaece6decd36a1..c61a01cb6ef13de8dcd83017ca256c3a1cdbe16f 100644 (file)
@@ -144,89 +144,6 @@ namespace cds { namespace container {
             cds::urcu::details::conventional_exempt_member_cast<leaf_node, value_type>
         > exempt_ptr;
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor
-        {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const& v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        template <typename Func>
-        class insert_key_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_key_wrapper( Func f ): base_class(f) {}
-
-            void operator()( leaf_node& item )
-            {
-                base_class::get()( item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_wrapper( Func f) : base_class(f) {}
-
-            void operator()( bool bNew, leaf_node& item, leaf_node const& )
-            {
-                base_class::get()( bNew, item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( leaf_node& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-#   endif
-        //@endcond
-
     public:
         /// Default constructor
         EllenBinTreeMap()
@@ -253,11 +170,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -319,13 +232,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } ))
-#       else
-            insert_key_wrapper<Func> wrapper(func);
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#endif
-            {
+            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -386,14 +293,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&func](bool bNew, leaf_node& item, leaf_node const& ){ cds::unref(func)( bNew, item.m_Value ); }
             );
-#       else
-            ensure_wrapper<Func> wrapper( func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -446,12 +348,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -464,13 +361,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool erase_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
                 [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts an item with minimal key from the map
@@ -571,12 +463,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( key, cds::ref(wrapper) );
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -589,13 +476,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
                 [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p key
index ea2a0071fbf1f8317c1fca0e6a9d586b514f8ba7..739d3a0bcc634874ca4bf75a2ad52294e2adfe2c 100644 (file)
@@ -175,74 +175,6 @@ namespace cds { namespace container {
         /// Guarded pointer
         typedef cds::gc::guarded_ptr< gc, leaf_node, value_type, details::guarded_ptr_cast_set<leaf_node, value_type> > guarded_ptr;
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, leaf_node& node, leaf_node& )
-            {
-                cds::unref(m_func)( bNew, node.m_Value, m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node const& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( leaf_node& node, Q& val )
-            {
-                cds::unref(m_func)( node.m_Value, val );
-            }
-        };
-#endif
-        //@endcond
-
     public:
         /// Default constructor
         EllenBinTreeSet()
@@ -297,13 +229,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } ))
-#       else
-            insert_functor<Func> wrapper(f);
-            if ( base_class::insert( *sp, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -345,13 +271,8 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( const Q& val, Func func )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
                 [&func, &val](bool bNew, leaf_node& node, leaf_node&){ cds::unref(func)( bNew, node.m_Value, val ); });
-#       else
-            ensure_functor<Q, Func> wrapper( val, func );
-            std::pair<bool, bool> bRes = base_class::ensure( *sp, cds::ref(wrapper));
-#       endif
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -423,12 +344,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -441,13 +357,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts an item with minimal key from the set
@@ -549,12 +460,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -567,14 +473,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
@@ -604,12 +504,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -622,14 +517,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q const& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
index 579da7a99e32a872648778f6527580ae330aba35..949f5c09ab8efeb95f01448b1e4848a797448dc7 100644 (file)
@@ -176,74 +176,6 @@ namespace cds { namespace container {
             cds::urcu::details::conventional_exempt_member_cast<leaf_node, value_type>
         > exempt_ptr;
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, leaf_node& node, leaf_node& )
-            {
-                cds::unref(m_func)( bNew, node.m_Value, m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( leaf_node const& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( leaf_node& node, Q& val )
-            {
-                cds::unref(m_func)( node.m_Value, val );
-            }
-        };
-#endif
-        //@endcond
-
     public:
         /// Default constructor
         EllenBinTreeSet()
@@ -300,13 +232,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } ))
-#       else
-            insert_functor<Func> wrapper(f);
-            if ( base_class::insert( *sp, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -350,13 +276,8 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( const Q& val, Func func )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
                 [&func, &val](bool bNew, leaf_node& node, leaf_node&){ cds::unref(func)( bNew, node.m_Value, val ); });
-#       else
-            ensure_functor<Q, Func> wrapper( val, func );
-            std::pair<bool, bool> bRes = base_class::ensure( *sp, cds::ref(wrapper));
-#       endif
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -436,12 +357,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -454,13 +370,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts an item with minimal key from the set
@@ -571,12 +482,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -589,14 +495,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q& val, Less pred, Func f ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
@@ -628,12 +528,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -646,14 +541,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q const& val, Less pred, Func f ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
index 7589cbbe1d12aa3f356d5c3a8314499fb6aad1a8..30b8b9b32b6497eb5c9175d1d2d5b7ecf9a5fa6f 100644 (file)
@@ -136,72 +136,6 @@ namespace cds { namespace container {
         /// Guarded pointer
         typedef cds::gc::guarded_ptr< gc, node_type, value_type, details::guarded_ptr_cast_map<node_type, value_type> > guarded_ptr;
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor ( Func f )
-                : base_class( f )
-            {}
-
-            void operator()( node_type& node )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class ensure_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor( Func f )
-                : base_class(f)
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                base_class::get()( bNew, node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func m_func;
-
-            erase_functor( Func f )
-                : m_func( f )
-            {}
-
-            void operator ()( node_type const & node )
-            {
-                cds::unref(m_func)( const_cast<value_type&>(node.m_Data) );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -826,13 +760,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); } ))
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( &refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); } )) {
                 pNode.release();
                 return true;
             }
@@ -854,12 +782,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool erase_at( head_type& refHead, K const& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){cds::unref(f)( const_cast<value_type&>(node.m_Data)); });
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename K, typename Compare>
@@ -873,13 +796,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
                 [&f]( bool bNew, node_type& node, node_type& ){ cds::unref(f)( bNew, node.m_Data ); });
-#   else
-            ensure_functor<Func> wrapper( f );
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -895,12 +813,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K& ){ cds::unref(f)( node.m_Data ); });
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename K, typename Compare>
index eba231af4eca2d017843d02fa23e9ccb56ecdea4..03e2b392e4c1e633b9b9a3280ceaecb7cd861d35 100644 (file)
@@ -92,41 +92,6 @@ namespace cds { namespace container {
         typedef typename base_class::node_type      head_type;
         //@endcond
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * m_pItemFound;
-
-            ensure_functor()
-                : m_pItemFound( nullptr )
-            {}
-
-            void operator ()(bool, node_type& item, node_type& )
-            {
-                m_pItemFound = &item;
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-#   endif   // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -566,13 +531,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
             node_type * pItemFound = nullptr;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&){ pItemFound = &item; } );
-#       else
-            ensure_functor func;
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, boost::ref(func) );
-            pItemFound = func.m_pItemFound;
-#       endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -596,12 +555,7 @@ namespace cds { namespace container {
         template <typename K, typenam Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K const& ){ cds::unref(f)( node.m_Data ); });
-#       else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( &refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
         */
         //@endcond
index 6dfb17e89e215c4fbdcc1a6a6bb32c0deceed51e..e854631d49506bd66b0f0a51c64afafedbb0b357 100644 (file)
@@ -140,79 +140,6 @@ namespace cds { namespace container {
             cds::urcu::details::conventional_exempt_pair_cast<node_type, value_type>
         > exempt_ptr;
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor ( Func f )
-                : base_class( f )
-            {}
-
-            void operator()( node_type& node )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class ensure_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor( Func f )
-                : base_class(f)
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                base_class::get()( bNew, node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        struct empty_find_functor
-        {
-            template <typename Q>
-            void operator ()( node_type& node, Q& val ) const
-            {}
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func m_func;
-
-            erase_functor( Func f )
-                : m_func( f )
-            {}
-
-            void operator ()( node_type const & node )
-            {
-                cds::unref(m_func)( const_cast<value_type&>(node.m_Data) );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -842,13 +769,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); } ))
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( &refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); } )) {
                 pNode.release();
                 return true;
             }
@@ -870,12 +791,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool erase_at( head_type& refHead, K const & key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){cds::unref(f)( const_cast<value_type&>(node.m_Data)); });
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename K, typename Func>
@@ -883,13 +799,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
                 [&f]( bool bNew, node_type& node, node_type& ){ cds::unref(f)( bNew, node.m_Data ); });
-#   else
-            ensure_functor<Func> wrapper( f );
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -905,22 +816,13 @@ namespace cds { namespace container {
         template <typename K, typename Compare>
         bool find_at( head_type& refHead, K const& key, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( &refHead, key, cmp, [](node_type&, K const&) {} );
-#       else
-            return base_class::find_at( &refHead, key, cmp, empty_find_functor() );
-#       endif
         }
 
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f ) const
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K& ){ cds::unref(f)( node.m_Data ); });
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename K, typename Compare>
index 51784f6fae10376475c915f5fadbf5edd5395e6b..0b0b67cfab7fc3392e5454e3679773096f5cec35 100644 (file)
@@ -135,9 +135,6 @@ namespace cds { namespace container {
         typedef typename options::type_traits::compare  intrusive_key_comparator;
 
         typedef typename base_class::node_type      head_type;
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        typedef typename base_class::empty_erase_functor    empty_erase_functor;
-#   endif
         //@endcond
 
     public:
@@ -154,71 +151,6 @@ namespace cds { namespace container {
         {
             return n.m_Value;
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            const Q&    m_arg;
-
-            ensure_functor( const Q& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node_to_value(node), m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node_to_value(node), val );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-#   endif   // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     protected:
@@ -524,11 +456,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool erase( Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, intrusive_key_comparator(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, intrusive_key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the list using \p pred predicate for searching
@@ -541,11 +469,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         bool erase_with( Q const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes \p key from the list
@@ -846,20 +770,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            if ( base_class::insert_at( &refHead, *pNode, [&f,n2v](node_type& node){ cds::unref(f)( n2v(node) ); } ))
-#       else
-            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node_to_value(node) ); } ))
-#       endif
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( &refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -869,19 +780,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, const Q& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type const& (* n2v)( node_type const& ) = node_to_value;
-            return base_class::erase_at( &refHead, key, cmp, [&f,n2v](node_type const& node){ cds::unref(f)( n2v(node) ); } );
-#       else
             return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
-#       endif
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
@@ -895,21 +794,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
-                [&f, &key, n2v](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, n2v(node), key ); });
-#       else
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
                 [&f, &key](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, node_to_value(node), key ); });
-#       endif
-#   else
-            ensure_functor<Q, Func> wrapper( key, f );
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -925,19 +811,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            return base_class::find_at( &refHead, val, cmp, [&f,n2v](node_type& node, Q& val){ cds::unref(f)( n2v(node), val ); });
-#       else
             return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ cds::unref(f)( node_to_value(node), val ); });
-#       endif
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( &refHead, val, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
index 24bc15526f4eb3144ba757c7399aa02f9f88ea65..3a5fbd72ccd035389909190dcd1daec5936986cc 100644 (file)
@@ -76,25 +76,6 @@ namespace cds { namespace container {
         typedef typename base_class::node_type      head_type;
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * m_pItemFound;
-
-            ensure_functor()
-                : m_pItemFound( nullptr )
-            {}
-
-            void operator ()(bool, node_type& item, node_type& )
-            {
-                m_pItemFound = &item;
-            }
-        };
-#   endif
-        //@endcond
-
     protected:
         //@cond
         static node_type * alloc_node()
@@ -430,14 +411,8 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( val ));
             node_type * pItemFound = nullptr;
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
                 [&pItemFound](bool, node_type& item, node_type&){ pItemFound = &item; });
-#   else
-            ensure_functor func;
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, boost::ref(func) );
-            pItemFound = func.m_pItemFound;
-#   endif
             assert( pItemFound != nullptr );
 
             if ( ret.first && ret.second )
index 0f95f58dd2a419d7aeaada061162dfb81f247795..59fa065b9aff71692326627667bd3bf7aeca7576 100644 (file)
@@ -140,9 +140,6 @@ namespace cds { namespace container {
         typedef typename maker::type_traits::compare  intrusive_key_comparator;
 
         typedef typename base_class::node_type      head_type;
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        typedef typename base_class::empty_erase_functor    empty_erase_functor;
-#   endif
         //@endcond
 
     public:
@@ -158,78 +155,6 @@ namespace cds { namespace container {
         {
             return n.m_Value;
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node_to_value(node), m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node_to_value(node), val );
-            }
-        };
-
-        struct empty_find_functor
-        {
-            template <typename Q>
-            void operator ()( node_type& node, Q& val ) const
-            {}
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-#   endif   // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     protected:
@@ -532,11 +457,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool erase( Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, intrusive_key_comparator(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, intrusive_key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the list using \p pred predicate for searching
@@ -549,11 +470,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         bool erase_with( Q const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, typename maker::template less_wrapper<Less>::type(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, typename maker::template less_wrapper<Less>::type(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes \p key from the list
@@ -875,20 +792,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            if ( base_class::insert_at( &refHead, *pNode, [&f,n2v](node_type& node){ cds::unref(f)( n2v(node) ); } ))
-#       else
-            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node_to_value(node) ); } ))
-#       endif
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( &refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -898,19 +802,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type const& (* n2v)( node_type const& ) = node_to_value;
-            return base_class::erase_at( &refHead, key, cmp, [&f,n2v](node_type const& node){ cds::unref(f)( n2v(node) ); } );
-#       else
             return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
-#       endif
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( &refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
@@ -924,21 +816,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
-                [&f, &key, n2v](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, n2v(node), key ); });
-#       else
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
                 [&f, &key](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, node_to_value(node), key ); });
-#       endif
-#   else
-            ensure_functor<Q, Func> wrapper( key, f );
-            std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -948,29 +827,13 @@ namespace cds { namespace container {
         template <typename Q, typename Compare>
         bool find_at( head_type& refHead, Q const& key, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( &refHead, key, cmp, [](node_type&, Q const &) {} );
-#       else
-            return base_class::find_at( &refHead, key, cmp, empty_find_functor() );
-#       endif
         }
 
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            return base_class::find_at( &refHead, val, cmp, [&f,n2v](node_type& node, Q& val){ cds::unref(f)( n2v(node), val ); });
-#       else
             return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ cds::unref(f)( node_to_value(node), val ); });
-#       endif
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( &refHead, val, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
index 589260798baa559ac2e627a1c2501d8b7de016b1..f9ae7ee75aefd0debce52ed469e2b6afa2712d0d 100644 (file)
@@ -136,72 +136,6 @@ namespace cds { namespace container {
         /// Guarded pointer
         typedef cds::gc::guarded_ptr< gc, node_type, value_type, details::guarded_ptr_cast_map<node_type, value_type> > guarded_ptr;
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor ( Func f )
-                : base_class( f )
-            {}
-
-            void operator()( node_type& node )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class ensure_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor( Func f )
-                : base_class(f)
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                base_class::get()( bNew, node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func m_func;
-
-            erase_functor( Func f )
-                : m_func( f )
-            {}
-
-            void operator ()( node_type const & node )
-            {
-                cds::unref(m_func)( const_cast<value_type&>(node.m_Data) );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -812,13 +746,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert_at( refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); }))
-#       else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( refHead, *pNode, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert_at( refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); })) {
                 pNode.release();
                 return true;
             }
@@ -836,13 +764,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
                 [&f]( bool bNew, node_type& node, node_type& ){ cds::unref(f)( bNew, node.m_Data ); });
-#       else
-            ensure_functor<Func> wrapper( f );
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, cds::ref(wrapper));
-#       endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -858,12 +781,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool erase_at( head_type& refHead, K const& key, Compare cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_at( refHead, key, cmp, [&f]( node_type const & node ){ cds::unref(f)( const_cast<value_type&>(node.m_Data)); });
-#       else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
         template <typename K, typename Compare>
         bool extract_at( head_type& refHead, typename gc::Guard& dest, K const& key, Compare cmp )
@@ -880,12 +798,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( refHead, key, cmp, [&f](node_type& node, K const&){ cds::unref(f)( node.m_Data ); });
-#       else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
 
         template <typename K, typename Compare>
index d9407d0c2b6987b70a5ec825236c4fb5cc16f122..5a42a8f50121a4d6cadc6c9b6dea62f14b9a715e 100644 (file)
@@ -93,41 +93,6 @@ namespace cds { namespace container {
         typedef typename base_class::atomic_node_ptr head_type;
         //@endcond
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * m_pItemFound;
-
-            ensure_functor()
-                : m_pItemFound( nullptr )
-            {}
-
-            void operator ()(bool, node_type& item, node_type& )
-            {
-                m_pItemFound = &item;
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-#   endif
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -547,13 +512,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
             node_type * pItemFound = nullptr;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&){ pItemFound = &item; });
-#       else
-            ensure_functor func;
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, boost::ref(func) );
-            pItemFound = func.m_pItemFound;
-#       endif
             assert( pItemFound != nullptr );
 
             if ( ret.first && ret.second )
@@ -577,12 +536,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( refHead, key, cmp, [&f]( node_type& node, K const& ){ cds::unref(f)( node.m_Data ); });
-#       else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
         */
         //@endcond
index c0d2cb99d3fe2b6a6f205e6ac338d0ff657babaa..d1aed822ddbceb2a1af9c243c99b3fa100251117 100644 (file)
@@ -141,79 +141,6 @@ namespace cds { namespace container {
             cds::urcu::details::conventional_exempt_pair_cast<node_type, value_type>
         > exempt_ptr;
 
-    private:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor ( Func f )
-                : base_class( f )
-            {}
-
-            void operator()( node_type& node )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class ensure_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor( Func f )
-                : base_class(f)
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                base_class::get()( bNew, node.m_Data );
-            }
-        };
-
-        template <typename Func>
-        class find_functor: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q&  )
-            {
-                base_class::get()( node.m_Data );
-            }
-        };
-
-        struct empty_find_functor
-        {
-            template <typename Q>
-            void operator ()( node_type& node, Q& val ) const
-            {}
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func m_func;
-
-            erase_functor( Func f )
-                : m_func( f )
-            {}
-
-            void operator ()( node_type const & node )
-            {
-                cds::unref(m_func)( const_cast<value_type&>(node.m_Data) );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         //@cond
         template <typename K>
@@ -824,13 +751,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert_at( refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); }))
-#       else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( refHead, *pNode, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert_at( refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); })) {
                 pNode.release();
                 return true;
             }
@@ -848,13 +769,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
                 [&f]( bool bNew, node_type& node, node_type& ){ cds::unref(f)( bNew, node.m_Data ); });
-#       else
-            ensure_functor<Func> wrapper( f );
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, cds::ref(wrapper));
-#       endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -870,12 +786,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool erase_at( head_type& refHead, K const& key, Compare cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_at( refHead, key, cmp, [&f]( node_type const & node ){ cds::unref(f)( const_cast<value_type&>(node.m_Data)); });
-#       else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
 
         template <typename K, typename Compare>
@@ -887,22 +798,13 @@ namespace cds { namespace container {
         template <typename K, typename Compare>
         bool find_at( head_type& refHead, K const& key, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( refHead, key, cmp, [](node_type&, K const&) {} );
-#       else
-            return base_class::find_at( refHead, key, cmp, empty_find_functor() );
-#       endif
         }
 
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( refHead, key, cmp, [&f](node_type& node, K const&){ cds::unref(f)( node.m_Data ); });
-#       else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( refHead, key, cmp, cds::ref(wrapper) );
-#       endif
         }
 
         template <typename K, typename Compare>
index d139ef782670c2066676c51af557179ef66dc304..60d37b595113fb019684367ca373d4153c3206b1 100644 (file)
@@ -125,9 +125,6 @@ namespace cds { namespace container {
         typedef typename options::type_traits::compare  intrusive_key_comparator;
 
         typedef typename base_class::atomic_node_ptr head_type;
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        typedef typename base_class::empty_erase_functor    empty_erase_functor;
-#   endif
         //@endcond
 
     public:
@@ -144,71 +141,6 @@ namespace cds { namespace container {
         {
             return n.m_Value;
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node_to_value(node), m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node_to_value(node), val );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-#endif  // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     protected:
@@ -495,11 +427,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool erase( Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, intrusive_key_comparator(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, intrusive_key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the list using \p pred predicate for searching
@@ -512,11 +440,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         bool erase_with( Q const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes \p key from the list
@@ -812,20 +736,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5,4.6,4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            if ( base_class::insert_at( refHead, *pNode, [&f, n2v]( node_type& node ) { cds::unref(f)( n2v(node) ); } ))
-#       else
-            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { cds::unref(f)( node_to_value(node) ); } ))
-#       endif
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { cds::unref(f)( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -841,19 +752,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type const& (* n2v)( node_type const& ) = node_to_value;
-            return base_class::erase_at( refHead, key, cmp, [&f,n2v](node_type const& node){ cds::unref(f)( n2v(node) ); } );
-#       else
             return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
-#       endif
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
@@ -867,21 +766,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
-                [&f, &key, n2v](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, n2v(node), key ); });
-#       else
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
                 [&f, &key](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, node_to_value(node), key ); });
-#       endif
-#   else
-            ensure_functor<Q, Func> wrapper( key, f );
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -897,19 +783,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            return base_class::find_at( refHead, val, cmp, [&f, n2v](node_type& node, Q& v){ cds::unref(f)( n2v(node), v ); });
-#       else
             return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ cds::unref(f)( node_to_value(node), v ); });
-#       endif
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( refHead, val, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
index 512d61737a997a62ba10caf01fcaeccf58efb3f8..170271c0998141e6c79012126a5c0432a57e7ca5 100644 (file)
@@ -75,25 +75,6 @@ namespace cds { namespace container {
         typedef typename base_class::atomic_node_ptr head_type;
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * m_pItemFound;
-
-            ensure_functor()
-                : m_pItemFound( nullptr )
-            {}
-
-            void operator ()(bool, node_type& item, node_type& )
-            {
-                m_pItemFound = &item;
-            }
-        };
-#   endif
-        //@endcond
-
     protected:
         //@cond
         static node_type * alloc_node()
@@ -408,13 +389,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( val ));
             node_type * pItemFound = nullptr;
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&) { pItemFound = &item; });
-#   else
-            ensure_functor func;
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, boost::ref(func) );
-            pItemFound = func.m_pItemFound;
-#   endif
             assert( pItemFound != nullptr );
 
             if ( ret.first && ret.second )
index 6d8ba10286a6ab4f33a60860376bef53f3bb4796..e3b579757fd8660b5b50658b426ddca801a2c9c1 100644 (file)
@@ -131,9 +131,6 @@ namespace cds { namespace container {
         typedef typename options::type_traits::compare  intrusive_key_comparator;
 
         typedef typename base_class::atomic_node_ptr      head_type;
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        typedef typename base_class::empty_erase_functor    empty_erase_functor;
-#   endif
         //@endcond
 
     public:
@@ -149,78 +146,6 @@ namespace cds { namespace container {
         {
             return n.m_Value;
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node_to_value(node), m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node_to_value(node), val );
-            }
-        };
-
-        struct empty_find_functor
-        {
-            template <typename Q>
-            void operator ()( node_type& node, Q& val ) const
-            {}
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node_to_value(node) );
-            }
-        };
-#endif  // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     protected:
@@ -501,11 +426,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool erase( Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, intrusive_key_comparator(),  [](value_type const&){} );
-#       else
-            return erase_at( head(), key, intrusive_key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the list using \p pred predicate for searching
@@ -518,11 +439,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         bool erase_with( Q const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), [](value_type const&){} );
-#       else
-            return erase_at( head(), key, typename options::template less_wrapper<Less>::type(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes \p key from the list
@@ -839,20 +756,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5,4.6,4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            if ( base_class::insert_at( refHead, *pNode, [&f, n2v]( node_type& node ) { cds::unref(f)( n2v(node) ); } ))
-#       else
-            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { cds::unref(f)( node_to_value(node) ); } ))
-#       endif
-#   else
-            insert_functor<Func>  wrapper( f );
-            if ( base_class::insert_at( refHead, *pNode, cds::ref(wrapper) ))
-#   endif
-            {
+            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { cds::unref(f)( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -868,19 +772,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type const& (* n2v)( node_type const& ) = node_to_value;
-            return base_class::erase_at( refHead, key, cmp, [&f,n2v](node_type const& node){ cds::unref(f)( n2v(node) ); } );
-#       else
             return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
-#       endif
-#   else
-            erase_functor<Func> wrapper( f );
-            return base_class::erase_at( refHead, key, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Func>
@@ -888,21 +780,8 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
-                [&f, &key, n2v](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, n2v(node), key ); });
-#       else
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
                 [&f, &key](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, node_to_value(node), key ); });
-#       endif
-#   else
-            ensure_functor<Q, Func> wrapper( key, f );
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, cds::ref(wrapper));
-#   endif
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -918,29 +797,13 @@ namespace cds { namespace container {
         template <typename Q, typename Compare>
         bool find_at( head_type& refHead, Q const& key, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_at( refHead, key, cmp, [](node_type&, Q const &) {} );
-#       else
-            return base_class::find_at( refHead, key, cmp, empty_find_functor() );
-#       endif
         }
 
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
-#       ifdef CDS_BUG_STATIC_MEMBER_IN_LAMBDA
-            // GCC 4.5-4.7: node_to_value is unaccessible from lambda,
-            // like as MichaelList::node_to_value that requires to capture *this* despite on node_to_value is static function
-            value_type& (* n2v)( node_type& ) = node_to_value;
-            return base_class::find_at( refHead, val, cmp, [&f, n2v](node_type& node, Q& v){ cds::unref(f)( n2v(node), v ); });
-#       else
             return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ cds::unref(f)( node_to_value(node), v ); });
-#       endif
-#   else
-            find_functor<Func>  wrapper( f );
-            return base_class::find_at( refHead, val, cmp, cds::ref(wrapper) );
-#   endif
         }
 
         template <typename Q, typename Compare>
index 9dd8f1339660dd57141cdd0ee0bc343c86866408..123bfba9b981d5237d849a664d22c0ab87afc9e1 100644 (file)
@@ -133,30 +133,8 @@ namespace cds { namespace container {
             {
                 cxx_allocator().Delete( p );
             }
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            void operator()( value_type& p ) const
-            {
-                cxx_allocator().Delete( &p );
-            }
-#       endif
         };
         typedef std::unique_ptr<value_type, value_deleter> scoped_ptr;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct clear_wrapper
-        {
-            Func& func;
-            clear_wrapper( Func& f ): func(f) {}
-
-            void operator()( value_type& src ) const
-            {
-                cds::unref(func)( src );
-                value_deleter()( &src );
-            }
-        };
-#   endif
-
         //@endcond
 
     public:
@@ -264,11 +242,7 @@ namespace cds { namespace container {
         */
         void clear()
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             base_class::clear_with( []( value_type& src ) { cxx_allocator().Delete( &src ); });
-#       else
-            base_class::clear_with( value_deleter() );
-#       endif
         }
 
         /// Clears the queue (not atomic)
@@ -288,12 +262,7 @@ namespace cds { namespace container {
         template <typename Func>
         void clear_with( Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             base_class::clear_with( [&f]( value_type& val ) { cds::unref(f)(val); value_deleter()( &val ); } );
-#       else
-            clear_wrapper<Func> c(f);
-            base_class::clear_with( cds::ref(c));
-#       endif
         }
 
         /// Checks is the priority queue is empty
index 736692cd0e0c823b71de9795c8a6eacc7e63d081..10afe27b1bd3a110faed63d1aea11960a1aa9162 100644 (file)
@@ -172,89 +172,6 @@ namespace cds { namespace container {
         }
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor
-        {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const & v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        template <typename Func>
-        class insert_key_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_key_wrapper( Func f ): base_class(f) {}
-
-            void operator()( node_type& item )
-            {
-                base_class::get()( item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_wrapper( Func f) : base_class(f) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& )
-            {
-                base_class::get()( bNew, item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-#   endif  // #ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     public:
         /// Default ctor
         SkipListMap()
@@ -323,11 +240,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -344,12 +257,7 @@ namespace cds { namespace container {
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [&val](value_type& item) { item.second = val ; } );
-#       else
-            insert_value_functor<V> f(val);
-            return insert_key( key, cds::ref(f) );
-#       endif
         }
 
         /// Inserts new node and initialize it by a functor
@@ -384,13 +292,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } ))
-#       else
-            insert_key_wrapper<Func> wrapper(func);
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#endif
-            {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -447,14 +349,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_Value ); }
             );
-#       else
-            ensure_wrapper<Func> wrapper( func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -503,12 +400,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -521,14 +413,9 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool erase_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key,
                 cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
                 [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts the item from the map with specified \p key
@@ -659,12 +546,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( key, cds::ref(wrapper) );
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -677,14 +559,9 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key,
                 cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
                 [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p key
index 46ce635a882bf9b56fd42281f4a9c0b00f500cbf..b8e96ec14e3f95e1cceedec34a6d99f33064ace2 100644 (file)
@@ -169,105 +169,6 @@ namespace cds { namespace container {
         }
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor
-        {
-            void operator()( value_type& ) const
-            {}
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const& v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        template <typename Func>
-        class insert_key_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_key_wrapper( Func f ): base_class(f) {}
-
-            void operator()( node_type& item )
-            {
-                base_class::get()( item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class ensure_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_wrapper( Func f) : base_class(f) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& )
-            {
-                base_class::get()( bNew, item.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        class find_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_wrapper( Func f )
-                : base_class(f)
-            {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-
-        template <typename Func>
-        struct extract_copy_wrapper
-        {
-            Func    m_func;
-            extract_copy_wrapper( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator()( Q& dest, node_type& src )
-            {
-                cds::unref(m_func)(dest, src.m_Value);
-            }
-        };
-
-#   endif  // #ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     public:
         /// Default ctor
         SkipListMap()
@@ -338,11 +239,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -361,14 +258,6 @@ namespace cds { namespace container {
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-            /*
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            return insert_key( key, [&val](value_type& item) { item.second = val ; } );
-#       else
-            insert_value_functor<V> f(val);
-            return insert_key( key, cds::ref(f) );
-#       endif
-            */
             scoped_node_ptr pNode( node_allocator().New( random_level(), key, val ));
             if ( base_class::insert( *pNode ))
             {
@@ -412,13 +301,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } ))
-#       else
-            insert_key_wrapper<Func> wrapper(func);
-            if ( base_class::insert( *pNode, cds::ref(wrapper) ))
-#endif
-            {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -479,14 +362,9 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> res = base_class::ensure( *pNode,
                 [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_Value ); }
             );
-#       else
-            ensure_wrapper<Func> wrapper( func );
-            std::pair<bool, bool> res = base_class::ensure( *pNode, cds::ref(wrapper) );
-#       endif
             if ( res.first && res.second )
                 pNode.release();
             return res;
@@ -539,12 +417,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -557,13 +430,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool erase_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
                 [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts the item from the map with specified \p key
@@ -655,12 +523,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find( key, cds::ref(wrapper) );
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -673,13 +536,8 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
                 [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
-#       else
-            find_wrapper<Func> wrapper(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(), cds::ref(wrapper) );
-#       endif
         }
 
         /// Find the key \p key
index e92b56704a101d30378e382f1e259ac57fc80e85..281e44dbd273ea7cd127707b07078ab127b1831a 100644 (file)
@@ -161,83 +161,6 @@ namespace cds { namespace container {
         }
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node.m_Value, m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node.m_Value, val );
-            }
-        };
-
-        struct copy_value_functor {
-            template <typename Q>
-            void operator()( Q& dest, value_type const& src ) const
-            {
-                dest = src;
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-#   endif  // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
-        //@endcond
-
     public:
         /// Default ctor
         SkipListSet()
@@ -334,13 +257,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } ))
-#       else
-            insert_functor<Func> wrapper(f);
-            if ( base_class::insert( *sp, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -382,13 +299,8 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( const Q& val, Func func )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
                 [&func, &val](bool bNew, node_type& node, node_type&){ cds::unref(func)( bNew, node.m_Value, val ); });
-#       else
-            ensure_functor<Q, Func> wrapper( val, func );
-            std::pair<bool, bool> bRes = base_class::ensure( *sp, cds::ref(wrapper));
-#       endif
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -462,12 +374,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -480,14 +387,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts the item from the set with specified \p key
@@ -627,12 +528,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -645,13 +541,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
@@ -681,12 +572,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -699,14 +585,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q const& val, Less cmp, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
index b549bc15fd14f5802c63301fed02edb532b63b9c..1aaf6b9867b3e9405322072e891c8bb0e9b6a9e0 100644 (file)
@@ -168,28 +168,6 @@ namespace cds { namespace container {
         >::type     key_accessor;
 
         typedef std::unique_ptr< node_type, typename maker::node_deallocator >    scoped_node_ptr;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * pNode;
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                pNode = &node;
-            }
-        };
-
-        struct find_functor
-        {
-            node_type * pNode;
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& )
-            {
-                pNode = &node;
-            }
-        };
-#   endif
         //@endcond
 
     public:
@@ -298,21 +276,12 @@ namespace cds { namespace container {
         std::pair<iterator, bool> ensure( const Q& val )
         {
             scoped_node_ptr sp( node_allocator().New( base_class::random_level(), val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             node_type * pNode;
             std::pair<bool, bool> bRes = base_class::ensure( *sp, [&pNode](bool, node_type& item, node_type&) { pNode = &item; } );
             if ( bRes.first && bRes.second )
                 sp.release();
             assert( pNode );
             return std::make_pair( node_to_iterator( pNode ), bRes.second );
-#       else
-            ensure_functor f;
-            std::pair<bool, bool> bRes = base_class::ensure( *sp, cds::ref(f) );
-            if ( bRes.first && bRes.second )
-                sp.release();
-            assert( f.pNode );
-            return std::make_pair( node_to_iterator( f.pNode ), bRes.second );
-#       endif
         }
 
         /// Searches \p key
index 2ea9f4970937d56e994f66c945e73308708404c2..632f2f9d78d6b0528e3909d2e75b4413df3f7428 100644 (file)
@@ -200,99 +200,6 @@ namespace cds { namespace container {
         }
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        struct insert_functor
-        {
-            Func        m_func;
-
-            insert_functor ( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Q, typename Func>
-        struct ensure_functor
-        {
-            Func        m_func;
-            Q const&    m_arg;
-
-            ensure_functor( Q const& arg, Func f )
-                : m_func(f)
-                , m_arg( arg )
-            {}
-
-            void operator ()( bool bNew, node_type& node, node_type& )
-            {
-                cds::unref(m_func)( bNew, node.m_Value, m_arg );
-            }
-        };
-
-        template <typename Func>
-        struct find_functor
-        {
-            Func    m_func;
-
-            find_functor( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator ()( node_type& node, Q& val )
-            {
-                cds::unref(m_func)( node.m_Value, val );
-            }
-        };
-
-        template <typename Func>
-        struct erase_functor
-        {
-            Func        m_func;
-
-            erase_functor( Func f )
-                : m_func(f)
-            {}
-
-            void operator()( node_type const& node )
-            {
-                cds::unref(m_func)( node.m_Value );
-            }
-        };
-
-        template <typename Func>
-        struct extract_copy_wrapper
-        {
-            Func    m_func;
-            extract_copy_wrapper( Func f )
-                : m_func(f)
-            {}
-
-            template <typename Q>
-            void operator()( Q& dest, node_type& src )
-            {
-                cds::unref(m_func)(dest, src.m_Value);
-            }
-        };
-
-        struct extract_assign_wrapper
-        {
-            template <typename Q>
-            void operator()( Q& dest, node_type& src ) const
-            {
-                dest = src.m_Value;
-            }
-        };
-#   endif  // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
-        //@endcond
-
     public:
         /// Default ctor
         SkipListSet()
@@ -393,13 +300,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } ))
-#       else
-            insert_functor<Func> wrapper(f);
-            if ( base_class::insert( *sp, cds::ref(wrapper) ))
-#       endif
-            {
+            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -443,13 +344,8 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( const Q& val, Func func )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
                 [&func, &val](bool bNew, node_type& node, node_type&){ cds::unref(func)( bNew, node.m_Value, val ); });
-#       else
-            ensure_functor<Q, Func> wrapper( val, func );
-            std::pair<bool, bool> bRes = base_class::ensure( *sp, cds::ref(wrapper));
-#       endif
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -529,12 +425,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase( key, cds::ref(wrapper));
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -547,13 +438,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor<Func> wrapper(f);
-            return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(), cds::ref(wrapper));
-#       endif
         }
 
         /// Extracts the item from the set with specified \p key
@@ -655,12 +541,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -673,14 +554,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
@@ -712,12 +587,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find( val, cds::ref(wrapper));
-#       endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -730,14 +600,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q const& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
                 [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
-#       else
-            find_functor<Func> wrapper(f);
-            return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                cds::ref(wrapper));
-#       endif
         }
 
         /// Find the key \p val
index 2e8b2b67973e121f82f7ffa7da39b5f1f3886bc2..eb8442c26da2ac2d8c7975dcf73d2ca67ff03c11 100644 (file)
@@ -141,45 +141,12 @@ namespace cds { namespace container {
         //@cond
         typedef typename base_class::maker::type_traits::key_accessor key_accessor;
         typedef typename base_class::node_type node_type;
+        //@endcond
 
     public:
         /// Guarded pointer
         typedef cds::gc::guarded_ptr< gc, node_type, value_type, details::guarded_ptr_cast_set<node_type, value_type> > guarded_ptr;
 
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class ensure_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor_wrapper() {}
-            ensure_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( bool bNew, value_type& item, const Q& /*val*/ )
-            {
-                base_class::get()( bNew, item );
-            }
-        };
-
-        template <typename Func>
-        class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor_wrapper() {}
-            find_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( value_type& pair, Q const& /*val*/ )
-            {
-                base_class::get()( pair );
-            }
-        };
-#   endif   // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     public:
         /// Forward iterator (see SplitListSet::iterator)
         /**
@@ -379,15 +346,10 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             //TODO: pass arguments by reference (make_pair makes copy)
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::ensure( std::make_pair( key, mapped_type() ),
                 [&func](bool bNew, value_type& item, value_type const& /*val*/) {
                     cds::unref(func)( bNew, item );
                 } );
-#   else
-            ensure_functor_wrapper<Func> fw( func );
-            return base_class::ensure( std::make_pair( key, mapped_type() ), cds::ref(fw) );
-#   endif
         }
 
         /// Deletes \p key from the map
@@ -520,12 +482,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
-#   else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find( key, cds::ref(fw) );
-#   endif
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -538,14 +495,9 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key,
                 cds::details::predicate_wrapper<value_type, Less, key_accessor>(),
                 [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
-#   else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper<value_type, Less, key_accessor>(), cds::ref(fw) );
-#   endif
         }
 
         /// Finds the key \p key
index b8bc6638dd2f06a5a153d1cfd08040a680608131..cc94b7426221a69809ea0d88f56776cf3df7453f 100644 (file)
@@ -186,38 +186,6 @@ namespace cds { namespace container {
     protected:
         //@cond
         typedef typename base_class::maker::type_traits::key_accessor key_accessor;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class ensure_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            ensure_functor_wrapper() {}
-            ensure_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( bool bNew, value_type& item, const Q& /*val*/ )
-            {
-                base_class::get()( bNew, item );
-            }
-        };
-
-        template <typename Func>
-        class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor_wrapper() {}
-            find_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( value_type& pair, Q const& /*val*/ )
-            {
-                base_class::get()( pair );
-            }
-        };
-#   endif   // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     public:
@@ -425,15 +393,10 @@ namespace cds { namespace container {
         std::pair<bool, bool> ensure( K const& key, Func func )
         {
             //TODO: pass arguments by reference (make_pair makes copy)
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::ensure( std::make_pair( key, mapped_type() ),
                 [&func](bool bNew, value_type& item, value_type const& /*val*/) {
                     cds::unref(func)( bNew, item );
                 } );
-#   else
-            ensure_functor_wrapper<Func> fw( func );
-            return base_class::ensure( std::make_pair( key, mapped_type() ), cds::ref(fw) );
-#   endif
         }
 
         /// Deletes \p key from the map
@@ -581,12 +544,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
-#   else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find( key, cds::ref(fw) );
-#   endif
         }
 
         /// Finds the key \p key using \p pred predicate for searching
@@ -599,14 +557,9 @@ namespace cds { namespace container {
         template <typename K, typename Less, typename Func>
         bool find_with( K const& key, Less pred, Func f )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key,
                 cds::details::predicate_wrapper<value_type, Less, key_accessor>(),
                 [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
-#   else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper<value_type, Less, key_accessor>(), cds::ref(fw) );
-#   endif
         }
 
         /// Finds the key \p key
index cfbe04bdb731c012d12eec89b03dc83a2799edf6..ebbf6a0b461399fe080cb7c20e9f7760f1bfb476 100644 (file)
@@ -172,24 +172,14 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find_( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find( val, cds::ref(fw) );
-#       endif
         }
 
         template <typename Q, typename Less, typename Func>
         bool find_with_( Q& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
                 [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(), cds::ref(fw) );
-#       endif
         }
 
         template <typename... Args>
@@ -226,65 +216,6 @@ namespace cds { namespace container {
 
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor_wrapper( Func f ): base_class(f) {}
-
-            void operator()(node_type& node)
-            {
-                base_class::get()( node.m_Value );
-            }
-        };
-
-        template <typename Func, typename Q>
-        class ensure_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-            Q const&    m_val;
-        public:
-            ensure_functor_wrapper( Func f, Q const& v ): base_class(f), m_val(v) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& /*val*/ )
-            {
-                base_class::get()( bNew, item.m_Value, m_val );
-            }
-        };
-
-        template <typename Func>
-        class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-
-        template <typename Func>
-        class erase_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            erase_functor_wrapper( Func f ): base_class( f ) {}
-
-            void operator()(node_type& node)
-            {
-                base_class::get()( node.m_Value );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-        //@endcond
-
     protected:
         /// Forward iterator
         /**
@@ -468,13 +399,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } ))
-#       else
-            insert_functor_wrapper<Func> fw(f);
-            if ( base_class::insert( *pNode, cds::ref(fw) ) )
-#       endif
-            {
+            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } )) {
                 pNode.release();
                 return true;
             }
@@ -527,15 +452,10 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRet = base_class::ensure( *pNode,
                 [&func, &val]( bool bNew, node_type& item,  node_type const& /*val*/ ) {
                     cds::unref(func)( bNew, item.m_Value, val );
                 } );
-#       else
-            ensure_functor_wrapper<Func, Q> fw( func, val );
-            std::pair<bool, bool> bRet = base_class::ensure( *pNode, cds::ref(fw) );
-#       endif
 
             if ( bRet.first && bRet.second )
                 pNode.release();
@@ -593,12 +513,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor_wrapper<Func> fw( f );
-            return base_class::erase( key, cds::ref(fw) );
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -611,13 +526,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(),
                 [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor_wrapper<Func> fw( f );
-            return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(), cds::ref(fw) );
-#       endif
         }
 
         /// Extracts the item with specified \p key
index 11a90ed1f30c6c67d0c1ee053174e6b2d41fc4d9..833e728fe2edac8822ed22843ba92b6aed2cd3eb 100644 (file)
@@ -81,21 +81,8 @@ namespace cds { namespace container {
             }
         };
         typedef std::unique_ptr< node_type, node_disposer >     scoped_node_ptr;
-
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_ensure_functor
-        {
-            void operator()( bool /*bNew*/, node_type& /*item*/, node_type& /*val*/ )
-            {}
-        };
-#   endif
-        //@endcond
-
-
     public:
         /// Initialize split-ordered list of default capacity
         /**
@@ -292,11 +279,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<typename base_class::iterator, bool> ret = base_class::ensure_( *pNode, [](bool /*bNew*/, node_type& /*item*/, node_type& /*val*/){} );
-#       else
-            std::pair<typename base_class::iterator, bool> ret = base_class::ensure_( *pNode, empty_ensure_functor() );
-#       endif
             if ( ret.first != base_class::end() && ret.second ) {
                 pNode.release();
                 return std::make_pair( iterator(ret.first), ret.second );
index 444756425f840d61571e1dcdc69b9dea0433e4eb..43101c4d4b215959e4debe9c92157252b84341fc 100644 (file)
@@ -217,24 +217,14 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find_( Q& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( val, [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find( val, cds::ref(fw) );
-#       endif
         }
 
         template <typename Q, typename Less, typename Func>
         bool find_with_( Q& val, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
                 [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(), cds::ref(fw) );
-#       endif
         }
 
 
@@ -269,73 +259,6 @@ namespace cds { namespace container {
 
             return false;
         }
-
-        //@endcond
-
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        template <typename Func>
-        class insert_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            insert_functor_wrapper( Func f ): base_class(f) {}
-
-            void operator()(node_type& node)
-            {
-                base_class::get()( node.m_Value );
-            }
-        };
-
-        template <typename Func, typename Q>
-        class ensure_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-            Q const&    m_val;
-        public:
-            ensure_functor_wrapper( Func f, Q const& v ): base_class(f), m_val(v) {}
-
-            void operator()( bool bNew, node_type& item, node_type const& /*val*/ )
-            {
-                base_class::get()( bNew, item.m_Value, m_val );
-            }
-        };
-
-        template <typename Func>
-        class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( node_type& item, Q& val )
-            {
-                base_class::get()( item.m_Value, val );
-            }
-        };
-
-        struct empty_find_functor
-        {
-            template <typename Q>
-            void operator()( node_type&, Q& )
-            {}
-        };
-
-        template <typename Func>
-        class erase_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            erase_functor_wrapper( Func f ): base_class( f ) {}
-
-            void operator()(node_type& node)
-            {
-                base_class::get()( node.m_Value );
-            }
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
         //@endcond
 
     protected:
@@ -522,13 +445,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } ))
-#       else
-            insert_functor_wrapper<Func> fw(f);
-            if ( base_class::insert( *pNode, cds::ref(fw) ) )
-#       endif
-            {
+            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } )) {
                 pNode.release();
                 return true;
             }
@@ -585,16 +502,10 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> bRet = base_class::ensure( *pNode,
                 [&func, &val]( bool bNew, node_type& item,  node_type const& /*val*/ ) {
                     cds::unref(func)( bNew, item.m_Value, val );
                 } );
-#       else
-            ensure_functor_wrapper<Func, Q> fw( func, val );
-            std::pair<bool, bool> bRet = base_class::ensure( *pNode, cds::ref(fw) );
-#       endif
-
             if ( bRet.first && bRet.second )
                 pNode.release();
             return bRet;
@@ -657,12 +568,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase( key, [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor_wrapper<Func> fw( f );
-            return base_class::erase( key, cds::ref(fw) );
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -675,13 +581,8 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool erase_with( Q const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(),
                 [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
-#       else
-            erase_functor_wrapper<Func> fw( f );
-            return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(), cds::ref(fw) );
-#       endif
         }
 
         /// Extracts an item from the set
index fd77756cc9d17a87948d9f0f252824720d65b69d..892225cb46a481aeef431c507689ad6fe31cdbd6 100644 (file)
@@ -8,10 +8,6 @@
 #include <cds/container/striped_set/adapter.h>
 #include <cds/details/binary_functor_wrapper.h>
 
-#ifndef CDS_CXX11_LAMBDA_SUPPORT
-#   include <cds/details/functor_wrapper.h>
-#endif
-
 namespace cds { namespace container {
 
     //@cond
@@ -537,46 +533,6 @@ template <class Container, typename... Options>
                 return p.first;
             }
         };
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-
-        template <typename Func>
-        class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-        {
-            typedef cds::details::functor_wrapper<Func> base_class;
-        public:
-            find_functor_wrapper() {}
-            find_functor_wrapper( Func f ): base_class(f) {}
-
-            template <typename Q>
-            void operator()( value_type& pair, Q const& /*val*/ )
-            {
-                base_class::get()( pair );
-            }
-        };
-
-        template <typename Q>
-        class insert_value_functor
-        {
-            Q const&    m_val;
-        public:
-            insert_value_functor( Q const & v)
-                : m_val(v)
-            {}
-
-            void operator()( value_type& item )
-            {
-                item.second = m_val;
-            }
-        };
-
-        struct dummy_insert_functor
-        {
-            void operator()( value_type& item )
-            {}
-        };
-#   endif  // #ifndef CDS_CXX11_LAMBDA_SUPPORT
-
         //@endcond
 
     public:
@@ -631,11 +587,7 @@ template <class Container, typename... Options>
         template <typename K>
         bool insert( K const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [](value_type&){} );
-#       else
-            return insert_key( key, dummy_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -652,12 +604,7 @@ template <class Container, typename... Options>
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert_key( key, [&val](value_type& item) { item.second = val ; } );
-#       else
-            insert_value_functor<V> f(val);
-            return insert_key( key, cds::ref(f) );
-#       endif
         }
 
         /// Inserts new node and initialize it by a functor
@@ -796,11 +743,7 @@ template <class Container, typename... Options>
             ,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_erase_with >::type >
         bool erase_with( K const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_with( key, pred, [](value_type const&) {} );
-#       else
-            return erase_with( key, pred, typename base_class::empty_erase_functor() );
-#       endif
         }
 
         /// Delete \p key from the map
@@ -866,12 +809,7 @@ template <class Container, typename... Options>
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find( key, [&f]( value_type& pair, K const& ) mutable { cds::unref(f)(pair); } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find( key, cds::ref(fw) );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate
@@ -889,13 +827,8 @@ template <class Container, typename... Options>
             ,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_find_with >::type >
         bool find_with( K const& key, Less pred, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return base_class::find_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >(),
                 [&f]( value_type& pair, K const& ) mutable { cds::unref(f)(pair); } );
-#       else
-            find_functor_wrapper<Func> fw(f);
-            return base_class::find_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >(), cds::ref(fw) );
-#       endif
         }
 
         /// Find the key \p key
index b51e7ccf1d4014b1ba794caf105353785d0f3910..8c82d5be3a28496328366db21d8bb3f34ea88def 100644 (file)
@@ -517,27 +517,6 @@ namespace cds { namespace container {
         typedef typename base_class::scoped_resize_lock scoped_resize_lock;
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-#   endif
-        //@endcond
-
     public:
         /// Default ctor. The initial capacity is 16.
         StripedSet()
@@ -590,11 +569,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool insert( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -718,11 +693,7 @@ namespace cds { namespace container {
         template <typename Q>
         bool erase( Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase( key, [](value_type const&) {} );
-#       else
-            return erase( key, empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -740,11 +711,7 @@ namespace cds { namespace container {
             ,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_erase_with >::type >
         bool erase_with( Q const& key, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_with( key, pred, [](value_type const&) {} );
-#       else
-            return erase_with( key, pred, empty_erase_functor() );
-#       endif
         }
 
         /// Delete \p key from the set
index 051f05b9a64f59a280ce31ca4555e7c9a5fda1e0..9e0234e4c38d443657d68fb9a342326579ce45f4 100644 (file)
@@ -108,15 +108,6 @@ namespace cds { namespace container {
             {}
         };
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct copy_construct {
-            void operator()( value_type& dest, value_type const& src )
-            {
-                new ( &dest ) value_type( src );
-            }
-        };
-#   endif
-
         typedef cds::details::trivial_assign< value_type, value_type > copy_assign;
 
         typedef typename options::buffer::template rebind<cell_type>::other buffer;
@@ -214,11 +205,7 @@ namespace cds { namespace container {
         /// @anchor cds_container_VyukovMPMCCycleQueue_enqueue Enqueues \p data to queue
         bool enqueue(value_type const& data )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return enqueue( data, [](value_type& dest, value_type const& src){ new ( &dest ) value_type( src ); });
-#       else
-            return enqueue( data, copy_construct() );
-#       endif
         }
 
         /// Enqueues data of type \ref cds_container_VyukovMPMCCycleQueue_value_type "value_type" constructed with <tt>std::forward<Args>(args)...</tt>
index 15924713b74f262f943aa6cb5698aa97964ad775..790a785240939147bd1f9f1b94ac429d621ae06f 100644 (file)
@@ -1904,39 +1904,6 @@ namespace cds { namespace intrusive {
 
         typedef size_t  hash_array[c_nArity]    ;   ///< hash array
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-#   endif
-
-#   if !defined(CDS_CXX11_LAMBDA_SUPPORT) || ((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL ) && _MSC_VER == 1600)
-        template <typename Disposer>
-        class disposer_wrapper: protected cds::details::functor_wrapper<Disposer>
-        {
-            typedef cds::details::functor_wrapper<Disposer> base_class;
-        public:
-            disposer_wrapper( Disposer d): base_class(d) {}
-
-            void operator()( node_type * pNode )
-            {
-                base_class::get()( node_traits::to_value_ptr( pNode ));
-            }
-        };
-#   endif
-
         struct position {
             bucket_iterator     itPrev;
             bucket_iterator     itFound;
@@ -2383,11 +2350,7 @@ namespace cds { namespace intrusive {
         */
         bool insert( value_type& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -2601,11 +2564,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         value_type * erase( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase( val, [](value_type const&) {} );
-#       else
-            return erase( val, empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -2619,11 +2578,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Predicate>
         value_type * erase_with( Q const& val, Predicate pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, typename predicate_wrapper<Predicate>::type(), [](value_type const&) {} );
-#       else
-            return erase_( val, typename predicate_wrapper<Predicate>::type(), empty_erase_functor() );
-#       endif
         }
 
         /// Delete the item from the set
@@ -2757,11 +2712,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool find( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find( val, [](value_type&, Q const& ) {} );
-#       else
-            return find( val, empty_find_functor() );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -2775,11 +2726,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Predicate>
         bool find_with( Q const& val, Predicate pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with( val, typename predicate_wrapper<Predicate>::type(), [](value_type& , Q const& ) {} );
-#       else
-            return find_with( val, typename predicate_wrapper<Predicate>::type(), empty_find_functor() );
-#       endif
         }
 
         /// Clears the set
@@ -2810,19 +2757,11 @@ namespace cds { namespace intrusive {
             // locks entire array
             scoped_full_lock sl( m_MutexPolicy );
 
-#   if !defined(CDS_CXX11_LAMBDA_SUPPORT) || ((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL ) && _MSC_VER == 1600)
-            disposer_wrapper<Disposer> disp( oDisposer );
-#       endif
             for ( unsigned int i = 0; i < c_nArity; ++i ) {
                 bucket_entry * pEntry = m_BucketTable[i];
                 bucket_entry * pEnd = pEntry + m_nBucketMask + 1;
                 for ( ; pEntry != pEnd ; ++pEntry ) {
-#       if defined(CDS_CXX11_LAMBDA_SUPPORT) && !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1600)
-                    // MSVC 10: error to call nested typedefs node_traits from lambda
                     pEntry->clear( [&oDisposer]( node_type * pNode ){ oDisposer( node_traits::to_value_ptr( pNode )) ; } );
-#       else
-                    pEntry->clear( cds::ref(disp) );
-#       endif
                 }
             }
             m_ItemCounter.reset();
index d8e6c0dd17b8d0da68200ab047655d43fda81f4a..63f0cc4c939cf67cc2ff14a2ba2026cbadc01e04 100644 (file)
@@ -318,53 +318,6 @@ namespace cds { namespace intrusive {
             m_Root.m_pLeft.store( &m_LeafInf1, memory_model::memory_order_relaxed );
             m_Root.m_pRight.store( &m_LeafInf2, memory_model::memory_order_release );
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct trivial_equal_functor {
-            template <typename Q>
-            bool operator()( Q const& , leaf_node const& ) const
-            {
-                return true;
-            }
-        };
-
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct assign_guard_functor {
-            typename gc::Guard&    m_guard;
-            assign_guard_functor( typename gc::Guard& guard )
-                : m_guard(guard)
-            {}
-
-            template <typename Q>
-            void operator()( value_type& val, Q& )
-            {
-                m_guard.assign( &val );
-            }
-
-            void operator()( value_type& val )
-            {
-                m_guard.assign( &val );
-            }
-        };
-
-#   endif
-
-#   if !defined(CDS_CXX11_LAMBDA_SUPPORT) || (CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10)
-        struct unlink_equal_functor {
-            bool operator()( value_type const& v, leaf_node const& n ) const
-            {
-                return &v == node_traits::to_value_ptr( n );
-            }
-        };
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-#   endif
         //@endcond
 
     public:
@@ -390,11 +343,7 @@ namespace cds { namespace intrusive {
         */
         bool insert( value_type& val )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#   else
-            return insert( val, empty_insert_functor() );
-#   endif
         }
 
         /// Inserts new node
@@ -532,14 +481,9 @@ namespace cds { namespace intrusive {
         */
         bool unlink( value_type& val )
         {
-#       if defined(CDS_CXX11_LAMBDA_SUPPORT) && !(CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10)
-            // vc10 generates an error for the lambda - it sees cds::intrusive::node_traits but not class-defined node_traits
             return erase_( val, node_compare(),
                 []( value_type const& v, leaf_node const& n ) -> bool { return &v == node_traits::to_value_ptr( n ); },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, node_compare(), unlink_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the tree
@@ -553,13 +497,9 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool erase( const Q& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, node_compare(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, node_compare(), trivial_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Delete the item from the tree with comparing functor \p pred
@@ -580,13 +520,9 @@ namespace cds { namespace intrusive {
                 node_traits
             > compare_functor;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, compare_functor(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, compare_functor(), trivial_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the tree
@@ -611,13 +547,9 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Func>
         bool erase( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, node_compare(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 f );
-#       else
-            return erase_( val, node_compare(), trivial_equal_functor(), f );
-#       endif
         }
 
         /// Delete the item from the tree with comparing functor \p pred
@@ -638,13 +570,9 @@ namespace cds { namespace intrusive {
                 node_traits
             > compare_functor;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, compare_functor(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 f );
-#       else
-            return erase_( val, compare_functor(), trivial_equal_functor(), f );
-#       endif
         }
 
         /// Extracts an item with minimal key from the tree
@@ -1444,14 +1372,9 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool extract_( typename gc::Guard& guard, Q const& key )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( key, node_compare(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [&guard]( value_type& found ) { guard.assign( &found ); } );
-#       else
-            assign_guard_functor f( guard );
-            return erase_( key, node_compare(), trivial_equal_functor(), cds::ref(f) );
-#       endif
         }
 
         template <typename Q, typename Less>
@@ -1464,14 +1387,9 @@ namespace cds { namespace intrusive {
                 node_traits
             > compare_functor;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( key, compare_functor(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [&guard]( value_type& found ) { guard.assign( &found ); } );
-#       else
-            assign_guard_functor f( guard );
-            return erase_( key, compare_functor(), trivial_equal_functor(), cds::ref(f) );
-#       endif
         }
 
         bool extract_max_( typename gc::Guard& guard )
@@ -1612,23 +1530,13 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool get_( typename gc::Guard& guard, Q const& val ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_( val, [&guard]( value_type& found, Q const& ) { guard.assign( &found ); } );
-#       else
-            assign_guard_functor f(guard);
-            return find_( val, cds::ref(f) );
-#       endif
         }
 
         template <typename Q, typename Less>
         bool get_with_( typename gc::Guard& guard, Q const& val, Less pred ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with_( val, pred, [&guard]( value_type& found, Q const& ) { guard.assign( &found ); } );
-#       else
-            assign_guard_functor f(guard);
-            return find_with_( val, pred, cds::ref(f) );
-#       endif
         }
 
         //@endcond
index 9e608ca412709a678f8130fdfbeaf915162d3134..e7029da4fbe286c564b6fe77694f92b326efb00f 100644 (file)
@@ -708,33 +708,6 @@ namespace cds { namespace intrusive {
             m_Root.m_pLeft.store( &m_LeafInf1, memory_model::memory_order_relaxed );
             m_Root.m_pRight.store( &m_LeafInf2, memory_model::memory_order_release );
         }
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct trivial_equal_functor {
-            template <typename Q>
-            bool operator()( Q const& , leaf_node const& ) const
-            {
-                return true;
-            }
-        };
-
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-#   endif
-#   if !defined(CDS_CXX11_LAMBDA_SUPPORT) || (CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10)
-        struct unlink_equal_functor {
-            bool operator()( value_type const& v, leaf_node const& n ) const
-            {
-                return &v == node_traits::to_value_ptr( n );
-            }
-        };
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-#   endif
         //@endcond
 
     public:
@@ -762,11 +735,7 @@ namespace cds { namespace intrusive {
         */
         bool insert( value_type& val )
         {
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#   else
-            return insert( val, empty_insert_functor() );
-#   endif
         }
 
         /// Inserts new node
@@ -922,14 +891,9 @@ namespace cds { namespace intrusive {
         */
         bool unlink( value_type& val )
         {
-#       if defined(CDS_CXX11_LAMBDA_SUPPORT) && !(CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10)
-            // vc10 generates an error for the lambda - it sees cds::intrusive::node_traits but not class-defined node_traits
             return erase_( val, node_compare(),
                 []( value_type const& v, leaf_node const& n ) -> bool { return &v == node_traits::to_value_ptr( n ); },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, node_compare(), unlink_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the tree
@@ -945,13 +909,9 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool erase( const Q& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, node_compare(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, node_compare(), trivial_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Delete the item from the tree with comparing functor \p pred
@@ -972,13 +932,9 @@ namespace cds { namespace intrusive {
                 node_traits
             > compare_functor;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, compare_functor(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 [](value_type const&) {} );
-#       else
-            return erase_( val, compare_functor(), trivial_equal_functor(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the tree
@@ -1005,13 +961,9 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Func>
         bool erase( Q const& val, Func f )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, node_compare(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 f );
-#       else
-            return erase_( val, node_compare(), trivial_equal_functor(), f );
-#       endif
         }
 
         /// Delete the item from the tree with comparing functor \p pred
@@ -1032,13 +984,9 @@ namespace cds { namespace intrusive {
                 node_traits
             > compare_functor;
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, compare_functor(),
                 []( Q const&, leaf_node const& ) -> bool { return true; },
                 f );
-#       else
-            return erase_( val, compare_functor(), trivial_equal_functor(), f );
-#       endif
         }
 
         /// Extracts an item with minimal key from the tree
index e21816547cb1c9da26213706c4cd9ab5b398ed7e..b8c4a73f94dd39e1f0dcc0db56d2764ccaf489e7 100644 (file)
@@ -294,13 +294,6 @@ namespace cds { namespace intrusive {
                 m_pos.unlock();
             }
         };
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_erase_functor {
-            void operator()( value_type const & item )
-            {}
-        };
-#   endif
         //@endcond
 
     protected:
@@ -1112,25 +1105,14 @@ namespace cds { namespace intrusive {
         bool erase_at( node_type * pHead, const Q& val, Compare cmp )
         {
             position pos;
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( pHead, val, cmp, [](value_type const &){}, pos );
-#       else
-            return erase_at( pHead, val, cmp, empty_erase_functor(), pos );
-#       endif
         }
 
         template <typename Q, typename Compare>
         bool extract_at( node_type * pHead, typename gc::Guard& gp, const Q& val, Compare cmp )
         {
             position pos;
-            if (
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                erase_at( pHead, val, cmp, [](value_type const &){}, pos )
-#       else
-                erase_at( pHead, val, cmp, empty_erase_functor(), pos )
-#       endif
-                )
-            {
+            if ( erase_at( pHead, val, cmp, [](value_type const &){}, pos )) {
                 gp.assign( pos.guards.template get<value_type>(position::guard_current_item) );
                 return true;
             }
index 9761bfded4b105406cb7309622e3bf2085c685eb..21adc8bead21edd1258c33a1c6da3ddbe739050d 100644 (file)
@@ -182,28 +182,6 @@ namespace cds { namespace intrusive {
         };
 
         typedef cds::urcu::details::check_deadlock_policy< gc, rcu_check_deadlock>   check_deadlock_policy;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_erase_functor {
-            void operator()( value_type const& item )
-            {}
-        };
-
-        struct get_functor {
-            value_type *    pFound;
-
-            get_functor()
-                : pFound( nullptr )
-            {}
-
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {
-                pFound = &item;
-            }
-        };
-#   endif
-
         //@endcond
 
     protected:
@@ -1084,11 +1062,7 @@ namespace cds { namespace intrusive {
         bool erase_at( node_type * pHead, Q const& val, Compare cmp )
         {
             position pos;
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( pHead, val, cmp, [](value_type const &){}, pos );
-#       else
-            return erase_at( pHead, val, cmp, empty_erase_functor(), pos );
-#       endif
         }
 
         template <typename Q, typename Compare>
@@ -1169,14 +1143,9 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Compare>
         value_type * get_at( node_type * pHead, Q const& val, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             value_type * pFound = nullptr;
             return find_at( pHead, val, cmp, [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
-#       else
-            get_functor gf;
-            return find_at( pHead, val, cmp, cds::ref( gf ) ) ? gf.pFound : nullptr;
-#       endif
         }
 
         //@endcond
index 83160c5fc4c1434347b6d44920af771a025b903f..fa8e1cb0c1fc527a98681a40b81f81078b78ebaf 100644 (file)
@@ -239,13 +239,6 @@ namespace cds { namespace intrusive {
             };
         };
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_erase_functor {
-            void operator()( value_type const & item )
-            {}
-        };
-#   endif
-
         struct clean_disposer {
             void operator()( value_type * p )
             {
@@ -1043,11 +1036,7 @@ namespace cds { namespace intrusive {
         bool erase_at( atomic_node_ptr& refHead, Q const& val, Compare cmp )
         {
             position pos;
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( refHead, val, cmp, [](value_type const&){}, pos );
-#       else
-            return erase_at( refHead, val, cmp, empty_erase_functor(), pos );
-#       endif
         }
 
         template <typename Q, typename Compare>
index adb1351437d40baf15494904a651bb44ef57896c..96e7f191b7b4a7f4c2e1fc72159e21b8df9f9af8 100644 (file)
@@ -107,28 +107,6 @@ namespace cds { namespace intrusive {
 
         typedef cds::urcu::details::check_deadlock_policy< gc, rcu_check_deadlock>   check_deadlock_policy;
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_erase_functor {
-            void operator()( value_type const & item )
-            {}
-        };
-
-        struct get_functor {
-            value_type *    pFound;
-
-            get_functor()
-                : pFound( nullptr )
-            {}
-
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {
-                pFound = &item;
-            }
-        };
-
-#   endif
-
         static void clear_links( node_type * pNode )
         {
             pNode->m_pNext.store( marked_node_ptr(), memory_model::memory_order_relaxed );
@@ -940,11 +918,7 @@ namespace cds { namespace intrusive {
         bool erase_at( atomic_node_ptr& refHead, const Q& val, Compare cmp )
         {
             position pos;
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_at( refHead, val, cmp, [](value_type const&){}, pos );
-#       else
-            return erase_at( refHead, val, cmp, empty_erase_functor(), pos );
-#       endif
         }
 
         template <typename Q, typename Compare >
@@ -991,16 +965,10 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Compare>
         value_type * get_at( atomic_node_ptr& refHead, Q const& val, Compare cmp ) const
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             value_type * pFound = nullptr;
             return find_at( refHead, val, cmp,
                 [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
-#       else
-            get_functor gf;
-            return find_at( refHead, val, cmp, cds::ref(gf) )
-                ? gf.pFound : nullptr;
-#       endif
         }
 
         template <typename Q, typename Compare>
index 0f29612a8d076311c91afdc6e61b82d9c7b4d92b..d0a8d8546df0c113a5d045fc4ea7223feaed343b 100644 (file)
@@ -204,17 +204,6 @@ namespace cds { namespace intrusive {
         };
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_cleaner
-        {
-            void operator()( value_type const& ) const
-            {}
-        };
-#   endif
-        //@endcond
-
     public:
         typedef typename traits::buffer::template rebind<node>::other   buffer_type ;   ///< Heap array buffer type
 
@@ -341,11 +330,7 @@ namespace cds { namespace intrusive {
         */
         void clear()
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             clear_with( []( value_type const& src ) {} );
-#       else
-            clear_with( empty_cleaner() );
-#       endif
         }
 
         /// Clears the queue (not atomic)
index b58ba19cc22b98988e8b1f89e1aa80783b73edc6..91e2acd4a4529d6139bf37b2c25b6349fbd8d078 100644 (file)
@@ -417,63 +417,6 @@ namespace cds { namespace intrusive {
 
             node_type *   pCur  ;   // guarded by guards; needed only for *ensure* function
         };
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-
-        struct get_functor {
-            typename gc::Guard& m_guard;
-
-            get_functor( typename gc::Guard& gp )
-                : m_guard(gp)
-            {}
-
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {
-                m_guard.assign( &item );
-            }
-        };
-
-        template <typename Func>
-        struct insert_at_ensure_functor {
-            Func m_func;
-            insert_at_ensure_functor( Func f ) : m_func(f) {}
-
-            void operator()( value_type& item )
-            {
-                cds::unref( m_func)( true, item, item );
-            }
-        };
-
-        struct copy_value_functor {
-            template <typename Q>
-            void operator()( Q& dest, value_type const& src ) const
-            {
-                dest = src;
-            }
-        };
-
-        struct dummy_copy_functor {
-            template <typename Q>
-            void operator()( Q&, value_type const&) const {}
-        };
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
         //@endcond
 
     protected:
@@ -895,12 +838,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Compare>
         bool get_with_( typename gc::Guard& guard, Q const& val, Compare cmp )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with_( val, cmp, [&guard](value_type& found, Q const& ) { guard.assign(&found); } );
-#       else
-            get_functor gf(guard);
-            return find_with_( val, cmp, cds::ref(gf) );
-#       endif
         }
 
         template <typename Q, typename Compare, typename Func>
@@ -946,14 +884,7 @@ namespace cds { namespace intrusive {
                 assert( cmp( *node_traits::to_value_ptr( pDel ), val ) == 0 );
 
                 unsigned int nHeight = pDel->height();
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {} )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractSuccess();
@@ -980,14 +911,7 @@ namespace cds { namespace intrusive {
                 unsigned int nHeight = pDel->height();
                 gDel.assign( node_traits::to_value_ptr(pDel) );
 
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {} )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractMinSuccess();
@@ -1014,14 +938,7 @@ namespace cds { namespace intrusive {
                 unsigned int nHeight = pDel->height();
                 gDel.assign( node_traits::to_value_ptr(pDel) );
 
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {} )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractMaxSuccess();
@@ -1117,11 +1034,7 @@ namespace cds { namespace intrusive {
         */
         bool insert( value_type& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -1226,10 +1139,6 @@ namespace cds { namespace intrusive {
             bool bTowerOk = nHeight > 1 && pNode->get_tower() != nullptr;
             bool bTowerMade = false;
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            insert_at_ensure_functor<Func> wrapper( func );
-#       endif
-
             position pos;
             while ( true )
             {
@@ -1251,12 +1160,7 @@ namespace cds { namespace intrusive {
                         bTowerOk = true;
                 }
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); }))
-#       else
-                if ( !insert_at_position( val, pNode, pos, cds::ref(wrapper) ))
-#       endif
-                {
+                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
                     m_Stat.onInsertRetry();
                     continue;
                 }
@@ -1301,14 +1205,7 @@ namespace cds { namespace intrusive {
             typename gc::Guard gDel;
             gDel.assign( node_traits::to_value_ptr(pDel) );
 
-            if ( node_traits::to_value_ptr( pDel ) == &val && try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                [](value_type const&) {}
-#       else
-                empty_erase_functor()
-#       endif
-            ))
-            {
+            if ( node_traits::to_value_ptr( pDel ) == &val && try_remove_at( pDel, pos, [](value_type const&) {} )) {
                 --m_ItemCounter;
                 m_Stat.onRemoveNode( nHeight );
                 m_Stat.onUnlinkSuccess();
@@ -1449,11 +1346,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool erase( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, key_comparator(), [](value_type const&) {} );
-#       else
-            return erase_( val, key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set with comparing functor \p pred
@@ -1468,11 +1361,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Less>
         bool erase_with( Q const& val, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
-#       else
-            return erase_( val, cds::opt::details::make_comparator_from_less<Less>(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set
@@ -1616,11 +1505,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool find( Q const & val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
-#       else
-            return find_with_( val, key_comparator(), empty_find_functor() );
-#       endif
         }
 
         /// Finds the key \p val with comparing functor \p pred
@@ -1634,11 +1519,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Less>
         bool find_with( Q const& val, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
-#       else
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), empty_find_functor() );
-#       endif
         }
 
         /// Finds the key \p val and return the item found
index 3062062b5d792c7c930f393fe34ceb576cc142d1..5564479ee10fa1ba38658c584a14ef22e434e44b 100644 (file)
@@ -410,31 +410,6 @@ namespace cds { namespace intrusive {
             node_type *   pCur;
         };
 
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-
-        template <typename Func>
-        struct insert_at_ensure_functor {
-            Func m_func;
-            insert_at_ensure_functor( Func f ) : m_func(f) {}
-
-            void operator()( value_type& item )
-            {
-                cds::unref( m_func)( true, item, item );
-            }
-        };
-
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
         class head_node: public node_type
         {
             typename node_type::atomic_ptr   m_Tower[c_nMaxHeight];
@@ -714,12 +689,7 @@ namespace cds { namespace intrusive {
                         bTowerOk = true;
                 }
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-                if ( !insert_at_position( val, pNode, pos, empty_insert_functor() ))
-#       else
-                if ( !insert_at_position( val, pNode, pos, []( value_type& ) {} ))
-#       endif
-                {
+                if ( !insert_at_position( val, pNode, pos, []( value_type& ) {} )) {
                     m_Stat.onInsertRetry();
                     continue;
                 }
@@ -768,10 +738,6 @@ namespace cds { namespace intrusive {
             bool bTowerOk = nHeight > 1 && pNode->get_tower() != nullptr;
             bool bTowerMade = false;
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            insert_at_ensure_functor<Func> wrapper( func );
-#       endif
-
             position pos;
             while ( true )
             {
@@ -793,12 +759,7 @@ namespace cds { namespace intrusive {
                         bTowerOk = true;
                 }
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); }))
-#       else
-                if ( !insert_at_position( val, pNode, pos, cds::ref(wrapper) ))
-#       endif
-                {
+                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
                     m_Stat.onInsertRetry();
                     continue;
                 }
@@ -910,12 +871,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         value_type * find( Q const& val ) const
         {
-            node_type * pNode =
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
-#       else
-                find_with_( val, key_comparator(), empty_find_functor() );
-#       endif
+            node_type * pNode = find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
             if ( pNode )
                 return node_traits::to_value_ptr( pNode );
             return nullptr;
@@ -931,12 +887,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Less>
         value_type * find_with( Q const& val, Less pred ) const
         {
-            node_type * pNode =
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
-#       else
-                find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), empty_find_functor() );
-#       endif
+            node_type * pNode = find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
             if ( pNode )
                 return node_traits::to_value_ptr( pNode );
             return nullptr;
index da58a7eab1d436d9d3296b714a0e4a037f287b2f..9d74a9741feb434da30f47ad6fcf1a5bab3c9e24 100644 (file)
@@ -597,55 +597,6 @@ namespace cds { namespace intrusive {
         };
 
         typedef cds::urcu::details::check_deadlock_policy< gc, rcu_check_deadlock>   check_deadlock_policy;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-
-        struct get_functor {
-            value_type *    pFound;
-
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {
-                pFound = &item;
-            }
-        };
-
-        template <typename Func>
-        struct insert_at_ensure_functor {
-            Func m_func;
-            insert_at_ensure_functor( Func f ) : m_func(f) {}
-
-            void operator()( value_type& item )
-            {
-                cds::unref( m_func)( true, item, item );
-            }
-        };
-
-        struct copy_value_functor {
-            template <typename Q>
-            void operator()( Q& dest, value_type const& src ) const
-            {
-                dest = src;
-            }
-        };
-
-#   endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
         //@endcond
 
     protected:
@@ -1194,14 +1145,7 @@ retry:
 
                 unsigned int const nHeight = pDel->height();
 
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    , true ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {}, true )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractSuccess();
@@ -1267,14 +1211,7 @@ retry:
                 pDel = pos.pCur;
                 unsigned int const nHeight = pDel->height();
 
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    , true ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {}, true )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractMinSuccess();
@@ -1322,14 +1259,7 @@ retry:
                 pDel = pos.pCur;
                 unsigned int const nHeight = pDel->height();
 
-                if ( try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    [](value_type const&) {}
-#       else
-                    empty_erase_functor()
-#       endif
-                    , true ))
-                {
+                if ( try_remove_at( pDel, pos, [](value_type const&) {}, true )) {
                     --m_ItemCounter;
                     m_Stat.onRemoveNode( nHeight );
                     m_Stat.onExtractMaxSuccess();
@@ -1521,11 +1451,7 @@ retry:
         */
         bool insert( value_type& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -1648,10 +1574,6 @@ retry:
                 bool bTowerOk = nHeight > 1 && pNode->get_tower() != nullptr;
                 bool bTowerMade = false;
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-                insert_at_ensure_functor<Func> wrapper( func );
-#       endif
-
                 rcu_lock rcuLock;
                 while ( true )
                 {
@@ -1673,12 +1595,7 @@ retry:
                             bTowerOk = true;
                     }
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                    if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); }))
-#       else
-                    if ( !insert_at_position( val, pNode, pos, cds::ref(wrapper) ))
-#       endif
-                    {
+                    if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
                         m_Stat.onInsertRetry();
                         continue;
                     }
@@ -1735,14 +1652,7 @@ retry:
 
                     unsigned int nHeight = pDel->height();
 
-                    if ( node_traits::to_value_ptr( pDel ) == &val && try_remove_at( pDel, pos,
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                        [](value_type const&) {}
-#       else
-                        empty_erase_functor()
-#       endif
-                        , false ))
-                    {
+                    if ( node_traits::to_value_ptr( pDel ) == &val && try_remove_at( pDel, pos, [](value_type const&) {}, false )) {
                         --m_ItemCounter;
                         m_Stat.onRemoveNode( nHeight );
                         m_Stat.onUnlinkSuccess();
@@ -1892,11 +1802,7 @@ retry:
         template <typename Q>
         bool erase( const Q& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return do_erase( val, key_comparator(), [](value_type const&) {} );
-#       else
-            return do_erase( val, key_comparator(), empty_erase_functor() );
-#       endif
         }
 
         /// Delete the item from the set with comparing functor \p pred
@@ -1909,11 +1815,7 @@ retry:
         template <typename Q, typename Less>
         bool erase_with( const Q& val, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return do_erase( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
-#       else
-            return do_erase( val, cds::opt::details::make_comparator_from_less<Less>(), empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set
@@ -2051,11 +1953,7 @@ retry:
         template <typename Q>
         bool find( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return do_find_with( val, key_comparator(), [](value_type& , Q const& ) {} );
-#       else
-            return do_find_with( val, key_comparator(), empty_find_functor() );
-#       endif
         }
 
         /// Finds the key \p val with comparing functor \p pred
@@ -2068,13 +1966,7 @@ retry:
         template <typename Q, typename Less>
         bool find_with( Q const& val, Less pred )
         {
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(),
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
-                [](value_type& , Q const& ) {}
-#       else
-                empty_find_functor()
-#       endif
-            );
+            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
         }
 
         /// Finds the key \p val and return the item found
@@ -2112,15 +2004,9 @@ retry:
         {
             assert( gc::is_locked());
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             value_type * pFound;
             return do_find_with( val, key_comparator(), [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
-#       else
-            get_functor gf;
-            return do_find_with( val, key_comparator(), cds::ref(gf) )
-                ? gf.pFound : nullptr;
-#       endif
         }
 
         /// Finds the key \p val and return the item found
@@ -2137,16 +2023,10 @@ retry:
         {
             assert( gc::is_locked());
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             value_type * pFound;
             return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(),
                 [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
-#       else
-            get_functor gf;
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(), cds::ref(gf) )
-                ? gf.pFound : nullptr;
-#       endif
         }
 
         /// Returns item count in the set
index 790b5ecb567f86a9ad2bfb5362b8a4e096df6f8a..be144f8402a424d8c5c1680364d39920d311e5d2 100644 (file)
@@ -464,13 +464,8 @@ namespace cds { namespace intrusive {
             dummy_node_type * pHead = get_bucket( nHash );
             assert( pHead != nullptr );
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return m_List.find_at( pHead, sv, cmp,
                 [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
-#       else
-            split_list::details::find_functor_wrapper<Func> ffw( f );
-            return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) );
-#       endif
         }
 
         template <typename Q, typename Compare>
index 9c1743a5d7b1f82618599370d33f008f67e4a89b..c8c99ed37adaf6fdae76de37f9de625d69c1475e 100644 (file)
@@ -573,24 +573,6 @@ namespace cds { namespace intrusive {
                 */
             };
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            template <typename Func>
-            class find_functor_wrapper: protected cds::details::functor_wrapper<Func>
-            {
-                typedef cds::details::functor_wrapper<Func> base_class;
-            public:
-                find_functor_wrapper( Func f )
-                    : base_class( f )
-                {}
-
-                template <typename ValueType, typename Q>
-                void operator()( ValueType& item, split_list::details::search_value_type<Q>& val )
-                {
-                    base_class::get()( item, val.val );
-                }
-            };
-#       endif
-
             template <class OrderedList, class Options>
             class rebind_list_options
             {
index f5f585dd205e0a956ca22fcb1f50e586e2675dab..6195115f0feb0c74245872cf248e0f652bb57069 100644 (file)
@@ -607,13 +607,8 @@ namespace cds { namespace intrusive {
             split_list::details::search_value_type<Q>  sv( val, split_list::regular_hash( nHash ));
             dummy_node_type * pHead = get_bucket( nHash );
             assert( pHead != nullptr );
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return m_List.find_at( pHead, sv, cmp,
                 [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
-#       else
-            split_list::details::find_functor_wrapper<Func> ffw( f );
-            return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) );
-#       endif
         }
 
         //@endcond
index 4eeb2b0c0ceac3bbe3f3386cc15f90443f62afec..8951f826a95b70fe645db357a483900d9ba95a18 100644 (file)
@@ -353,13 +353,8 @@ namespace cds { namespace intrusive {
             dummy_node_type * pHead = get_bucket( nHash );
             assert( pHead != nullptr );
 
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return m_List.find_at( pHead, sv, cmp,
                 [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
-#       else
-            split_list::details::find_functor_wrapper<Func> ffw( f );
-            return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) );
-#       endif
         }
 
         template <typename Q, typename Compare>
index 0e43f231a5b4af8b64820e211b9490912207316c..f038f3112599398c5c3ed84d2a76760f907d96d1 100644 (file)
@@ -305,24 +305,6 @@ namespace cds { namespace intrusive {
         typedef typename mutex_policy::scoped_cell_lock     scoped_cell_lock;
         typedef typename mutex_policy::scoped_full_lock     scoped_full_lock;
         typedef typename mutex_policy::scoped_resize_lock   scoped_resize_lock;
-
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct empty_insert_functor {
-            void operator()( value_type& )
-            {}
-        };
-
-        struct empty_erase_functor  {
-            void operator()( value_type const& )
-            {}
-        };
-
-        struct empty_find_functor {
-            template <typename Q>
-            void operator()( value_type& item, Q& val )
-            {}
-        };
-#   endif
         //@endcond
 
     protected:
@@ -489,11 +471,7 @@ namespace cds { namespace intrusive {
         */
         bool insert( value_type& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return insert( val, []( value_type& ) {} );
-#       else
-            return insert( val, empty_insert_functor() );
-#       endif
         }
 
         /// Inserts new node
@@ -611,11 +589,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         value_type * erase( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase( val, [](value_type const&) {} );
-#       else
-            return erase( val, empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -628,11 +602,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Less>
         value_type * erase_with( Q const& val, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return erase_with( val, pred, [](value_type const&) {} );
-#       else
-            return erase_with( val, pred, empty_erase_functor() );
-#       endif
         }
 
         /// Deletes the item from the set
@@ -782,11 +752,7 @@ namespace cds { namespace intrusive {
         template <typename Q>
         bool find( Q const& val )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find( val, [](value_type&, Q const& ) {} );
-#       else
-            return find( val, empty_find_functor() );
-#       endif
         }
 
         /// Find the key \p val using \p pred predicate
@@ -799,11 +765,7 @@ namespace cds { namespace intrusive {
         template <typename Q, typename Less>
         bool find_with( Q const& val, Less pred )
         {
-#       ifdef CDS_CXX11_LAMBDA_SUPPORT
             return find_with( val, pred, [](value_type& , Q const& ) {} );
-#       else
-            return find_with( val, pred, empty_find_functor() );
-#       endif
         }
 
         /// Clears the set
index 5360cadb053831d2f1eff302b93d28aa2dbec4c4..8d95114bbd1ef32f8826764fe0a264979206bec0 100644 (file)
@@ -206,13 +206,6 @@ namespace cds { namespace intrusive {
                 typedef typename container_type::value_compare  key_comparator;
 
             private:
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-                struct empty_insert_functor {
-                    void operator()( value_type& )
-                    {}
-                };
-#       endif
-
                 container_type  m_Set;
 
             public:
@@ -315,11 +308,7 @@ namespace cds { namespace intrusive {
                 {
                     value_type& val = *itWhat;
                     from.base_container().erase( itWhat );
-#           ifdef CDS_CXX11_LAMBDA_SUPPORT
                     insert( val, []( value_type& ) {} );
-#           else
-                    insert( val, empty_insert_functor() );
-#           endif
                 }
             };
         }   // namespace details
index 54beb6af525060b10ef18669b863462377e9978a..1bda29ae1fc52c08d891e5ef62d3e2589856811d 100644 (file)
@@ -46,13 +46,6 @@ namespace cds { namespace intrusive { namespace striped_set {
                 }
             };
 
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            struct empty_insert_functor {
-                void operator()( value_type& )
-                {}
-            };
-#       endif
-
             template <typename Q, typename Pred>
             iterator find_key( Q const& key, Pred pred)
             {
@@ -192,11 +185,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 value_type& val = *itWhat;
                 from.base_container().erase( itWhat );
-#           ifdef CDS_CXX11_LAMBDA_SUPPORT
                 insert( val, []( value_type& ) {} );
-#           else
-                insert( val, empty_insert_functor() );
-#           endif
             }
 
         };
index c42a763a8b2770ae41392d8e27046bb7919bde55..8edced6816e2b053ced981e67f8ccb44a1d6c9df 100644 (file)
@@ -83,14 +83,6 @@ namespace cds { namespace intrusive { namespace striped_set {
                 return &val;
             }
 
-
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            struct empty_insert_functor {
-                void operator()( value_type& )
-                {}
-            };
-#       endif
-
         private:
             container_type  m_List;
 
@@ -209,11 +201,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 value_type& val = *itWhat;
                 from.base_container().erase( itWhat );
-#           ifdef CDS_CXX11_LAMBDA_SUPPORT
                 insert( val, []( value_type& ) {} );
-#           else
-                insert( val, empty_insert_functor() );
-#           endif
             }
 
         };
index 24464cfc5df0fb5ad88c65d896ebbd659c8ed524..f4a8fb3c1c2c0bde4542565c779e4b032e60997f 100644 (file)
@@ -34,13 +34,6 @@ namespace cds { namespace intrusive { namespace striped_set {
             typedef cds::intrusive::striped_set::load_factor_resizing<256>   default_resizing_policy;
 
         private:
-#       ifndef CDS_CXX11_LAMBDA_SUPPORT
-            struct empty_insert_functor {
-                void operator()( value_type& )
-                {}
-            };
-#       endif
-
             template <typename Compare>
             struct equal_from_compare
             {
@@ -174,11 +167,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 value_type& val = *itWhat;
                 from.base_container().erase( itWhat );
-#           ifdef CDS_CXX11_LAMBDA_SUPPORT
                 insert( val, []( value_type& ) {} );
-#           else
-                insert( val, empty_insert_functor() );
-#           endif
             }
         };
 
index 35c8a9bcc521737f296429bef946b4c45df7d624..ba69873cf97f796ce7f2d642cf374086ead4895a 100644 (file)
@@ -161,14 +161,6 @@ namespace cds { namespace intrusive {
                 /// Operation descriptor used in elimination back-off
                 typedef treiber_stack::operation< T >  operation_desc;
 
-#           if !(defined(CDS_CXX11_LAMBDA_SUPPORT) && !(CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10))
-                struct bkoff_predicate {
-                    operation_desc * pOp;
-                    bkoff_predicate( operation_desc * p ): pOp(p) {}
-                    bool operator()() { return pOp->nStatus.load( atomics::memory_order_acquire ) != op_busy; }
-                };
-#           endif
-
                 /// Elimination back-off data
                 struct elimination_data {
                     elimination_random_engine   randEngine; ///< random engine
@@ -243,19 +235,7 @@ namespace cds { namespace intrusive {
                     }
 
                     // Wait for colliding operation
-#               if defined(CDS_CXX11_LAMBDA_SUPPORT) && !(CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC10)
-                    // MSVC++ 2010 compiler error C2065: 'op_busy' : undeclared identifier
                     bkoff( [&op]() -> bool { return op.nStatus.load( atomics::memory_order_acquire ) != op_busy; } );
-#               else
-                    // Local structs is not supported by old compilers (for example, GCC 4.3)
-                    //struct bkoff_predicate {
-                    //    operation_desc * pOp;
-                    //    bkoff_predicate( operation_desc * p ): pOp(p) {}
-                    //    bool operator()() { return pOp->nStatus.load( atomics::memory_order_acquire ) != op_busy; }
-                    //};
-                    bkoff( bkoff_predicate(&op) );
-#               endif
-
                     {
                         slot_scoped_lock l( slot.lock );
                         if ( slot.pRec == myRec )