From: khizmax Date: Thu, 5 Mar 2015 13:10:33 +0000 (+0300) Subject: Fixed passing parameter pack into lambda X-Git-Tag: v2.1.0~305^2~28 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=0c187bfe8066762d0470d56c78d451d3bd3e9a3c Fixed passing parameter pack into lambda --- diff --git a/cds/container/bronson_avltree_map_rcu.h b/cds/container/bronson_avltree_map_rcu.h index b0c24749..8278c6e6 100644 --- a/cds/container/bronson_avltree_map_rcu.h +++ b/cds/container/bronson_avltree_map_rcu.h @@ -236,12 +236,19 @@ namespace cds { namespace container { template bool emplace( K&& key, Args&&... args ) { + auto helper = []( Args&&... args ) -> mapped_type * + { + return cxx_allocator().New( std::forward(args)...); + }; + return base_class::do_update( key, key_comparator(), - [&]( node_type * pNode ) -> mapped_type* + [=]( node_type * pNode ) -> mapped_type * { assert( pNode->m_pValue.load( memory_model::memory_order_relaxed ) == nullptr ); CDS_UNUSED( pNode ); - return cxx_allocator().New( std::forward(args)...); + return helper( args... ); + // gcc/clang error: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226 + //return cxx_allocator().New( std::forward(args)...); }, update_flags::allow_insert ) == update_flags::result_inserted;