From ad4a851ec0a60a0d843d5bdeab8799655df27bf4 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 23 Sep 2014 17:33:05 +0400 Subject: [PATCH] Remove CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT macro and emulating code --- cds/compiler/clang/defs.h | 3 - cds/compiler/defs.h | 1 + cds/compiler/gcc/defs.h | 2 - cds/compiler/icl/defs.h | 3 - cds/compiler/vc/defs.h | 3 - cds/container/ellen_bintree_base.h | 2 - cds/details/aligned_allocator.h | 60 --- cds/details/allocator.h | 87 ----- cds/details/defs.h | 2 +- cds/details/functor_wrapper.h | 75 ---- cds/intrusive/striped_set/adapter.h | 2 +- cds/memory/michael/allocator.h | 19 - cds/memory/pool_allocator.h | 2 +- cds/opt/hash.h | 395 ------------------- cds/opt/make_options_std.h | 535 -------------------------- cds/opt/options.h | 6 +- projects/Win/vc12/cds.vcxproj | 1 - projects/Win/vc12/cds.vcxproj.filters | 3 - 18 files changed, 5 insertions(+), 1196 deletions(-) delete mode 100644 cds/opt/make_options_std.h diff --git a/cds/compiler/clang/defs.h b/cds/compiler/clang/defs.h index 5438396c..85b18d12 100644 --- a/cds/compiler/clang/defs.h +++ b/cds/compiler/clang/defs.h @@ -25,9 +25,6 @@ #define alignof __alignof__ -// Variadic template support (only if -std=c++0x compile-line option provided) -#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT - // Default template arguments for function templates #define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT diff --git a/cds/compiler/defs.h b/cds/compiler/defs.h index 315ff626..baa94b61 100644 --- a/cds/compiler/defs.h +++ b/cds/compiler/defs.h @@ -5,6 +5,7 @@ /* Required C++11 features: + - variadic template [CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT] - template alias [CDS_CXX11_TEMPLATE_ALIAS_SUPPORT] - explicit conversion operator [CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT] */ diff --git a/cds/compiler/gcc/defs.h b/cds/compiler/gcc/defs.h index 2e6dc49a..22f08fd1 100644 --- a/cds/compiler/gcc/defs.h +++ b/cds/compiler/gcc/defs.h @@ -26,8 +26,6 @@ // *************************************** // C++11 features -#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT - // RValue #define CDS_RVALUE_SUPPORT #define CDS_MOVE_SEMANTICS_SUPPORT diff --git a/cds/compiler/icl/defs.h b/cds/compiler/icl/defs.h index b32550a8..29120961 100644 --- a/cds/compiler/icl/defs.h +++ b/cds/compiler/icl/defs.h @@ -100,9 +100,6 @@ // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]] #define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT -// Variadic template support (ICL 12.1+) -#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1 - // C++11 inline namespace #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT diff --git a/cds/compiler/vc/defs.h b/cds/compiler/vc/defs.h index 080827e1..64218429 100644 --- a/cds/compiler/vc/defs.h +++ b/cds/compiler/vc/defs.h @@ -103,9 +103,6 @@ // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]] #define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT -// Variadic template support (VC12+) -#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1 - // C++11 inline namespace //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT diff --git a/cds/container/ellen_bintree_base.h b/cds/container/ellen_bintree_base.h index 80d8e6df..cc99d3a2 100644 --- a/cds/container/ellen_bintree_base.h +++ b/cds/container/ellen_bintree_base.h @@ -61,7 +61,6 @@ namespace cds { namespace container { : m_Value(v) {} -#ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT /// Copy constructor template node( Args const&... args) @@ -75,7 +74,6 @@ namespace cds { namespace container { : m_Value( std::forward(args)... ) {} #endif // CDS_RVALUE_SUPPORT -#endif // CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT }; /// EllenBinTreeMap leaf node diff --git a/cds/details/aligned_allocator.h b/cds/details/aligned_allocator.h index 85ff72a4..150a821e 100644 --- a/cds/details/aligned_allocator.h +++ b/cds/details/aligned_allocator.h @@ -35,43 +35,12 @@ namespace cds { namespace details { /// Underlying aligned allocator type typedef typename ALIGNED_ALLOCATOR::template rebind::other allocator_type; -# ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT /// Analogue of operator new T(\p src... ) template T * New( size_t nAlign, const S&... src ) { return Construct( allocator_type::allocate( nAlign, 1), src... ); } -# else - //@cond - /// Analogue of operator new T - T * New( size_t nAlign ) - { - return Construct( allocator_type::allocate(nAlign, 1) ); - } - - /// Analogue of operator new T(\p src ) - template - T * New( size_t nAlign, const S& src ) - { - return Construct( allocator_type::allocate( nAlign, 1), src ); - } - - /// Analogue of operator new T( \p s1, \p s2 ) - template - T * New( size_t nAlign, const S1& s1, const S2& s2 ) - { - return Construct( allocator_type::allocate( nAlign, 1 ), s1, s2 ); - } - - /// Analogue of operator new T( \p s1, \p s2, \p s3 ) - template - T * New( size_t nAlign, const S1& s1, const S2& s2, const S3& s3 ) - { - return Construct( allocator_type::allocate(nAlign, 1), s1, s2, s3 ); - } - //@endcond -# endif /// Analogue of operator new T[\p nCount ] T * NewArray( size_t nAlign, size_t nCount ) @@ -110,41 +79,12 @@ namespace cds { namespace details { allocator_type::deallocate( p, nCount ); } -# ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT /// Analogue of placement operator new( \p p ) T( \p src... ) template T * Construct( void * p, const S&... src ) { return new( p ) T( src... ); } -# else - /// Analogue of placement operator new( \p p ) T - T * Construct( void * p ) - { - return new( p ) T; - } - - /// Analogue of placement operator new( \p p ) T( \p src ) - template - T * Construct( void * p, const S& src ) - { - return new( p ) T( src ); - } - - /// Analogue of placement operator new( \p p ) T( \p s1, \p s2 ) - template - T * Construct( void * p, const S1& s1, const S2& s2 ) - { - return new( p ) T( s1, s2 ); - } - - /// Analogue of placement operator new( \p p ) T( \p s1, \p s2, \p s3 ) - template - T * Construct( void * p, const S1& s1, const S2& s2, const S3& s3 ) - { - return new( p ) T( s1, s2, s3 ); - } -# endif /// Rebinds allocator to other type \p Q instead of \p T template diff --git a/cds/details/allocator.h b/cds/details/allocator.h index 7733c62d..c621b9f5 100644 --- a/cds/details/allocator.h +++ b/cds/details/allocator.h @@ -43,43 +43,12 @@ namespace cds { /// Element type typedef T value_type; -# ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT /// Analogue of operator new T(\p src... ) template value_type * New( S const&... src ) { return Construct( allocator_type::allocate(1), src... ); } -# else - //@cond - /// Analogue of operator new T - value_type * New() - { - return Construct( allocator_type::allocate(1) ); - } - - /// Analogue of operator new T(\p src ) - template - value_type * New( S const& src ) - { - return Construct( allocator_type::allocate(1), src ); - } - - /// Analogue of operator new T( \p s1, \p s2 ) - template - value_type * New( S1 const& s1, S2 const& s2 ) - { - return Construct( allocator_type::allocate(1), s1, s2 ); - } - - /// Analogue of operator new T( \p s1, \p s2, \p s3 ) - template - value_type * New( S1 const& s1, S2 const& s2, S3 const& s3 ) - { - return Construct( allocator_type::allocate(1), s1, s2, s3 ); - } - //@endcond -# endif # ifdef CDS_EMPLACE_SUPPORT /// Analogue of operator new T( std::forward(args)... ) (move semantics) @@ -117,7 +86,6 @@ namespace cds { return p; } -# ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT # if CDS_COMPILER == CDS_COMPILER_INTEL //@cond value_type * NewBlock( size_t nSize ) @@ -138,29 +106,6 @@ namespace cds { { return Construct( heap_alloc( nSize ), src... ); } -# else - //@cond - value_type * NewBlock( size_t nSize ) - { - return Construct( heap_alloc( nSize )); - } - template - value_type * NewBlock( size_t nSize, S const& arg ) - { - return Construct( heap_alloc( nSize ), arg ); - } - template - value_type * NewBlock( size_t nSize, S1 const& arg1, S2 const& arg2 ) - { - return Construct( heap_alloc( nSize ), arg1, arg2 ); - } - template - value_type * NewBlock( size_t nSize, S1 const& arg1, S2 const& arg2, S3 const& arg3 ) - { - return Construct( heap_alloc( nSize ), arg1, arg2, arg3 ); - } - //@endcond -# endif /// Analogue of operator delete void Delete( value_type * p ) @@ -177,7 +122,6 @@ namespace cds { allocator_type::deallocate( p, nCount ); } -# ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT # if CDS_COMPILER == CDS_COMPILER_INTEL //@cond value_type * Construct( void * p ) @@ -192,37 +136,6 @@ namespace cds { { return new( p ) value_type( src... ); } -# else - //@cond - /// Analogue of placement operator new( \p p ) T - value_type * Construct( void * p ) - { - return new( p ) value_type; - } - - - /// Analogue of placement operator new( \p p ) T( \p src ) - template - value_type * Construct( void * p, S const& src ) - { - return new( p ) value_type( src ); - } - - /// Analogue of placement operator new( \p p ) T( \p s1, \p s2 ) - template - value_type * Construct( void * p, S1 const& s1, S2 const& s2 ) - { - return new( p ) value_type( s1, s2 ); - } - - /// Analogue of placement operator new( \p p ) T( \p s1, \p s2, \p s3 ) - template - value_type * Construct( void * p, S1 const& s1, S2 const& s2, S3 const& s3 ) - { - return new( p ) value_type( s1, s2, s3 ); - } - //@endcond -# endif # ifdef CDS_EMPLACE_SUPPORT /// Analogue of placement operator new( p ) T( std::forward(args)... ) diff --git a/cds/details/defs.h b/cds/details/defs.h index b74820f9..ea3c05f8 100644 --- a/cds/details/defs.h +++ b/cds/details/defs.h @@ -350,7 +350,7 @@ namespace cds {} # define CDS_NOEXCEPT_DEFAULTED_(expr) CDS_NOEXCEPT_( expr ) #endif -#if defined(CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT) && defined(CDS_MOVE_SEMANTICS_SUPPORT) +#if defined(CDS_MOVE_SEMANTICS_SUPPORT) # define CDS_EMPLACE_SUPPORT #endif diff --git a/cds/details/functor_wrapper.h b/cds/details/functor_wrapper.h index 3fb1daff..a8ca972f 100644 --- a/cds/details/functor_wrapper.h +++ b/cds/details/functor_wrapper.h @@ -54,7 +54,6 @@ namespace cds { namespace details { } }; -#ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT template struct functor_wrapper { @@ -72,80 +71,6 @@ namespace cds { namespace details { return *m_func; } }; -#else - template - struct functor_wrapper - { - typedef Result (* func_ptr)(); - typedef Result (& func_ref)(); - func_ptr m_func; - public: - functor_wrapper( func_ptr f ) - : m_func(f) - {} - - func_ref get() - { - assert( m_func ); - return *m_func; - } - }; - - template - struct functor_wrapper - { - typedef Result (* func_ptr)(Arg1); - typedef Result (& func_ref)(Arg1); - func_ptr m_func; - public: - functor_wrapper( func_ptr f ) - : m_func(f) - {} - - func_ref get() - { - assert( m_func ); - return *m_func; - } - }; - - template - struct functor_wrapper - { - typedef Result (* func_ptr)(Arg1, Arg2); - typedef Result (& func_ref)(Arg1, Arg2); - func_ptr m_func; - public: - functor_wrapper( func_ptr f ) - : m_func(f) - {} - - func_ref get() - { - assert( m_func ); - return *m_func; - } - }; - - template - struct functor_wrapper - { - typedef Result (* func_ptr)(Arg1, Arg2, Arg3); - typedef Result (& func_ref)(Arg1, Arg2, Arg3); - func_ptr m_func; - public: - functor_wrapper( func_ptr f ) - : m_func(f) - {} - - func_ref get() - { - assert( m_func ); - return *m_func; - } - }; - -#endif }} // namespace cds::details //@endcond diff --git a/cds/intrusive/striped_set/adapter.h b/cds/intrusive/striped_set/adapter.h index f544731f..e12a65ef 100644 --- a/cds/intrusive/striped_set/adapter.h +++ b/cds/intrusive/striped_set/adapter.h @@ -329,7 +329,7 @@ namespace cds { namespace intrusive { }} // namespace cds::intrusive //@cond -#if defined(CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT) && defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) +#if defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) # define CDS_BOOST_INTRUSIVE_DECL_OPTIONS3 typename... BIOptions # define CDS_BOOST_INTRUSIVE_DECL_OPTIONS4 typename... BIOptions # define CDS_BOOST_INTRUSIVE_DECL_OPTIONS5 typename... BIOptions diff --git a/cds/memory/michael/allocator.h b/cds/memory/michael/allocator.h index cbc9f4a7..f7efa001 100644 --- a/cds/memory/michael/allocator.h +++ b/cds/memory/michael/allocator.h @@ -688,22 +688,7 @@ namespace michael { \endcode */ -#ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT template -#else - template < - typename O1 = opt::none, - typename O2 = opt::none, - typename O3 = opt::none, - typename O4 = opt::none, - typename O5 = opt::none, - typename O6 = opt::none, - typename O7 = opt::none, - typename O8 = opt::none, - typename O9 = opt::none, - typename O10= opt::none - > -#endif class Heap { protected: @@ -727,11 +712,7 @@ namespace michael { protected: //@cond -#ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT typedef typename opt::make_options::type options; -#else - typedef typename opt::make_options::type options; -#endif //@endcond //@cond diff --git a/cds/memory/pool_allocator.h b/cds/memory/pool_allocator.h index e821749c..c09955f9 100644 --- a/cds/memory/pool_allocator.h +++ b/cds/memory/pool_allocator.h @@ -102,7 +102,7 @@ namespace cds { namespace memory { return size_t(-1) / sizeof(value_type); } -# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && defined(CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT) +# if defined(CDS_MOVE_SEMANTICS_SUPPORT) template void construct(U* p, Args&&... args) { diff --git a/cds/opt/hash.h b/cds/opt/hash.h index 6d5a88d7..2b460b56 100644 --- a/cds/opt/hash.h +++ b/cds/opt/hash.h @@ -63,7 +63,6 @@ namespace cds { namespace opt { //@endcond } // namespace v -#ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT //@cond namespace details { template struct hash_list; @@ -131,400 +130,6 @@ namespace cds { namespace opt { //@endcond }; -#else // no variadic template support - namespace details { - template struct hash_list; - template - struct hash_list< std::tuple > - { - static size_t const size = 2; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 3; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 4; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 5; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 6; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - dest[5] = std::get<5>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 7; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - dest[5] = std::get<5>( hash_tuple )( v ); - dest[6] = std::get<6>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 8; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - dest[5] = std::get<5>( hash_tuple )( v ); - dest[6] = std::get<6>( hash_tuple )( v ); - dest[7] = std::get<7>( hash_tuple )( v ); - } - }; - -#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1700) - // MSVC 11: max count of argument is 8 - - template - struct hash_list< std::tuple > - { - static size_t const size = 9; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - dest[5] = std::get<5>( hash_tuple )( v ); - dest[6] = std::get<6>( hash_tuple )( v ); - dest[7] = std::get<7>( hash_tuple )( v ); - dest[8] = std::get<8>( hash_tuple )( v ); - } - }; - - template - struct hash_list< std::tuple > - { - static size_t const size = 10; - typedef size_t values[size]; - typedef std::tuple hash_tuple_type; - - hash_tuple_type hash_tuple; - - hash_list() - {} - hash_list( hash_tuple_type const& t) - : hash_tuple( t ) - {} -# ifdef CDS_MOVE_SEMANTICS_SUPPORT - hash_list( hash_tuple_type&& t) - : hash_tuple( t ) - {} -# endif - - template - void operator()( size_t * dest, T const& v ) const - { - dest[0] = std::get<0>( hash_tuple )( v ); - dest[1] = std::get<1>( hash_tuple )( v ); - dest[2] = std::get<2>( hash_tuple )( v ); - dest[3] = std::get<3>( hash_tuple )( v ); - dest[4] = std::get<4>( hash_tuple )( v ); - dest[5] = std::get<5>( hash_tuple )( v ); - dest[6] = std::get<6>( hash_tuple )( v ); - dest[7] = std::get<7>( hash_tuple )( v ); - dest[8] = std::get<8>( hash_tuple )( v ); - dest[9] = std::get<9>( hash_tuple )( v ); - } - }; -#endif - } // namespace details - - template< typename F1, typename F2 > - struct hash< std::tuple< F1, F2 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3 > - struct hash< std::tuple< F1, F2, F3 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4 > - struct hash< std::tuple< F1, F2, F3, F4 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4, typename F5 > - struct hash< std::tuple< F1, F2, F3, F4, F5 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4, typename F5, typename F6 > - struct hash< std::tuple< F1, F2, F3, F4, F5, F6 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4, typename F5, typename F6, typename F7 > - struct hash< std::tuple< F1, F2, F3, F4, F5, F6, F7 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4, typename F5, typename F6, typename F7, typename F8 > - struct hash< std::tuple< F1, F2, F3, F4, F5, F6, F7, F8 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - -#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1700) - // MSVC 11: max count of argument is 8 - - template< typename F1, typename F2, typename F3, typename F4, typename F5, typename F6, typename F7, typename F8, typename F9 > - struct hash< std::tuple< F1, F2, F3, F4, F5, F6, F7, F8, F9 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; - template< typename F1, typename F2, typename F3, typename F4, typename F5, typename F6, typename F7, typename F8, typename F9, - typename F10 > - struct hash< std::tuple< F1, F2, F3, F4, F5, F6, F7, F8, F9, F10 > > - { - //@cond - template struct pack: public Base - { - typedef details::hash_list< std::tuple > hash; - }; - //@endcond - }; -#endif // !MSVC11 -#endif // #ifdef CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT //@cond namespace details { diff --git a/cds/opt/make_options_std.h b/cds/opt/make_options_std.h deleted file mode 100644 index a85d9af2..00000000 --- a/cds/opt/make_options_std.h +++ /dev/null @@ -1,535 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_OPT_MAKE_OPTIONS_STD_H -#define __CDS_OPT_MAKE_OPTIONS_STD_H - -#ifndef __CDS_OPT_OPTIONS_H -# error must be included instead of -#endif - -#include - -// @cond - -#define CDS_DECL_OPTIONS1 typename O1=cds::opt::none -#define CDS_DECL_OPTIONS2 CDS_DECL_OPTIONS1,typename O2=cds::opt::none -#define CDS_DECL_OPTIONS3 CDS_DECL_OPTIONS2,typename O3=cds::opt::none -#define CDS_DECL_OPTIONS4 CDS_DECL_OPTIONS3,typename O4=cds::opt::none -#define CDS_DECL_OPTIONS5 CDS_DECL_OPTIONS4,typename O5=cds::opt::none -#define CDS_DECL_OPTIONS6 CDS_DECL_OPTIONS5,typename O6=cds::opt::none -#define CDS_DECL_OPTIONS7 CDS_DECL_OPTIONS6,typename O7=cds::opt::none -#define CDS_DECL_OPTIONS8 CDS_DECL_OPTIONS7,typename O8=cds::opt::none -#define CDS_DECL_OPTIONS9 CDS_DECL_OPTIONS8,typename O9=cds::opt::none -#define CDS_DECL_OPTIONS10 CDS_DECL_OPTIONS9,typename O10=cds::opt::none -#define CDS_DECL_OPTIONS11 CDS_DECL_OPTIONS10,typename O11=cds::opt::none -#define CDS_DECL_OPTIONS12 CDS_DECL_OPTIONS11,typename O12=cds::opt::none -#define CDS_DECL_OPTIONS13 CDS_DECL_OPTIONS12,typename O13=cds::opt::none -#define CDS_DECL_OPTIONS14 CDS_DECL_OPTIONS13,typename O14=cds::opt::none -#define CDS_DECL_OPTIONS15 CDS_DECL_OPTIONS14,typename O15=cds::opt::none -#define CDS_DECL_OPTIONS16 CDS_DECL_OPTIONS15,typename O16=cds::opt::none - -#define CDS_DECL_OPTIONS CDS_DECL_OPTIONS16 - -#define CDS_DECL_OTHER_OPTIONS1 typename OO1=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS2 CDS_DECL_OTHER_OPTIONS1,typename OO2=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS3 CDS_DECL_OTHER_OPTIONS2,typename OO3=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS4 CDS_DECL_OTHER_OPTIONS3,typename OO4=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS5 CDS_DECL_OTHER_OPTIONS4,typename OO5=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS6 CDS_DECL_OTHER_OPTIONS5,typename OO6=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS7 CDS_DECL_OTHER_OPTIONS6,typename OO7=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS8 CDS_DECL_OTHER_OPTIONS7,typename OO8=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS9 CDS_DECL_OTHER_OPTIONS8,typename OO9=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS10 CDS_DECL_OTHER_OPTIONS9,typename OO10=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS11 CDS_DECL_OTHER_OPTIONS10,typename OO11=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS12 CDS_DECL_OTHER_OPTIONS11,typename OO12=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS13 CDS_DECL_OTHER_OPTIONS12,typename OO13=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS14 CDS_DECL_OTHER_OPTIONS13,typename OO14=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS15 CDS_DECL_OTHER_OPTIONS14,typename OO15=cds::opt::none -#define CDS_DECL_OTHER_OPTIONS16 CDS_DECL_OTHER_OPTIONS15,typename OO16=cds::opt::none - -// for template specializations -#define CDS_SPEC_OPTIONS1 typename O1 -#define CDS_SPEC_OPTIONS2 CDS_SPEC_OPTIONS1,typename O2 -#define CDS_SPEC_OPTIONS3 CDS_SPEC_OPTIONS2,typename O3 -#define CDS_SPEC_OPTIONS4 CDS_SPEC_OPTIONS3,typename O4 -#define CDS_SPEC_OPTIONS5 CDS_SPEC_OPTIONS4,typename O5 -#define CDS_SPEC_OPTIONS6 CDS_SPEC_OPTIONS5,typename O6 -#define CDS_SPEC_OPTIONS7 CDS_SPEC_OPTIONS6,typename O7 -#define CDS_SPEC_OPTIONS8 CDS_SPEC_OPTIONS7,typename O8 -#define CDS_SPEC_OPTIONS9 CDS_SPEC_OPTIONS8,typename O9 -#define CDS_SPEC_OPTIONS10 CDS_SPEC_OPTIONS9,typename O10 -#define CDS_SPEC_OPTIONS11 CDS_SPEC_OPTIONS10,typename O11 -#define CDS_SPEC_OPTIONS12 CDS_SPEC_OPTIONS11,typename O12 -#define CDS_SPEC_OPTIONS13 CDS_SPEC_OPTIONS12,typename O13 -#define CDS_SPEC_OPTIONS14 CDS_SPEC_OPTIONS13,typename O14 -#define CDS_SPEC_OPTIONS15 CDS_SPEC_OPTIONS14,typename O15 -#define CDS_SPEC_OPTIONS16 CDS_SPEC_OPTIONS15,typename O16 - -#define CDS_SPEC_OPTIONS CDS_SPEC_OPTIONS16 - -#define CDS_OPTIONS1 O1 -#define CDS_OPTIONS2 O1,O2 -#define CDS_OPTIONS3 O1,O2,O3 -#define CDS_OPTIONS4 O1,O2,O3,O4 -#define CDS_OPTIONS5 O1,O2,O3,O4,O5 -#define CDS_OPTIONS6 O1,O2,O3,O4,O5,O6 -#define CDS_OPTIONS7 O1,O2,O3,O4,O5,O6,O7 -#define CDS_OPTIONS8 O1,O2,O3,O4,O5,O6,O7,O8 -#define CDS_OPTIONS9 O1,O2,O3,O4,O5,O6,O7,O8,O9 -#define CDS_OPTIONS10 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10 -#define CDS_OPTIONS11 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11 -#define CDS_OPTIONS12 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12 -#define CDS_OPTIONS13 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13 -#define CDS_OPTIONS14 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14 -#define CDS_OPTIONS15 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15 -#define CDS_OPTIONS16 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16 -//#define CDS_OPTIONS17 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17 -//#define CDS_OPTIONS18 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17,O18 -//#define CDS_OPTIONS19 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17,O18,O19 -//#define CDS_OPTIONS20 O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17,O18,O19,O20 - -#define CDS_OPTIONS CDS_OPTIONS16 - -#define CDS_OTHER_OPTIONS1 OO1 -#define CDS_OTHER_OPTIONS2 OO1,OO2 -#define CDS_OTHER_OPTIONS3 OO1,OO2,OO3 -#define CDS_OTHER_OPTIONS4 OO1,OO2,OO3,OO4 -#define CDS_OTHER_OPTIONS5 OO1,OO2,OO3,OO4,OO5 -#define CDS_OTHER_OPTIONS6 OO1,OO2,OO3,OO4,OO5,OO6 -#define CDS_OTHER_OPTIONS7 OO1,OO2,OO3,OO4,OO5,OO6,OO7 -#define CDS_OTHER_OPTIONS8 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8 -#define CDS_OTHER_OPTIONS9 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9 -#define CDS_OTHER_OPTIONS10 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10 -#define CDS_OTHER_OPTIONS11 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11 -#define CDS_OTHER_OPTIONS12 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11,OO12 -#define CDS_OTHER_OPTIONS13 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11,OO12,OO13 -#define CDS_OTHER_OPTIONS14 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11,OO12,OO13,OO14 -#define CDS_OTHER_OPTIONS15 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11,OO12,OO13,OO14,OO15 -#define CDS_OTHER_OPTIONS16 OO1,OO2,OO3,OO4,OO5,OO6,OO7,OO8,OO9,OO10,OO11,OO12,OO13,OO14,OO15,OO16 - -namespace cds { namespace opt { - - template - struct do_pack - { - // Use "pack" member template to pack options - typedef typename Option::template pack type; - }; - - template < - typename DefaultOptions - ,typename O1 = none - ,typename O2 = none - ,typename O3 = none - ,typename O4 = none - ,typename O5 = none - ,typename O6 = none - ,typename O7 = none - ,typename O8 = none - ,typename O9 = none - ,typename O10 = none - ,typename O11 = none - ,typename O12 = none - ,typename O13 = none - ,typename O14 = none - ,typename O15 = none - ,typename O16 = none - > - struct make_options { - /* - typedef - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - DefaultOptions - ,O16 - >::type - ,O15 - >::type - ,O14 - >::type - ,O13 - >::type - ,O12 - >::type - ,O11 - >::type - ,O10 - >::type - ,O9 - >::type - ,O8 - >::type - ,O7 - >::type - ,O6 - >::type - ,O5 - >::type - ,O4 - >::type - ,O3 - >::type - ,O2 - >::type - ,O1 - >::type - type; - */ - struct type: public - do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - typename do_pack< - DefaultOptions - ,O16 - >::type - ,O15 - >::type - ,O14 - >::type - ,O13 - >::type - ,O12 - >::type - ,O11 - >::type - ,O10 - >::type - ,O9 - >::type - ,O8 - >::type - ,O7 - >::type - ,O6 - >::type - ,O5 - >::type - ,O4 - >::type - ,O3 - >::type - ,O2 - >::type - ,O1 - >::type - {}; - }; - - - // ***************************************************************** - // find_type_traits metafunction - // ***************************************************************** - - namespace details { - template - struct find_type_traits_option { - typedef DefaultOptions type; - }; - - template - struct find_type_traits_option< cds::opt::type_traits, DefaultOptions> { - typedef T type; - }; - } - - template < - typename DefaultOptions - ,typename O1 = none - ,typename O2 = none - ,typename O3 = none - ,typename O4 = none - ,typename O5 = none - ,typename O6 = none - ,typename O7 = none - ,typename O8 = none - ,typename O9 = none - ,typename O10 = none - ,typename O11 = none - ,typename O12 = none - ,typename O13 = none - ,typename O14 = none - ,typename O15 = none - ,typename O16 = none - > - struct find_type_traits { - /* - typedef typename details::find_type_traits_option< O1, - typename details::find_type_traits_option< O2, - typename details::find_type_traits_option< O3, - typename details::find_type_traits_option< O4, - typename details::find_type_traits_option< O5, - typename details::find_type_traits_option< O6, - typename details::find_type_traits_option< O7, - typename details::find_type_traits_option< O8, - typename details::find_type_traits_option< O9, - typename details::find_type_traits_option< O10, - typename details::find_type_traits_option< O11, - typename details::find_type_traits_option< O12, - typename details::find_type_traits_option< O13, - typename details::find_type_traits_option< O14, - typename details::find_type_traits_option< O15, - typename details::find_type_traits_option< O16, DefaultOptions>::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type type; - */ - struct type: public details::find_type_traits_option< O1, - typename details::find_type_traits_option< O2, - typename details::find_type_traits_option< O3, - typename details::find_type_traits_option< O4, - typename details::find_type_traits_option< O5, - typename details::find_type_traits_option< O6, - typename details::find_type_traits_option< O7, - typename details::find_type_traits_option< O8, - typename details::find_type_traits_option< O9, - typename details::find_type_traits_option< O10, - typename details::find_type_traits_option< O11, - typename details::find_type_traits_option< O12, - typename details::find_type_traits_option< O13, - typename details::find_type_traits_option< O14, - typename details::find_type_traits_option< O15, - typename details::find_type_traits_option< O16, DefaultOptions>::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - >::type - {}; - }; - - - // ***************************************************************** - // find_option metafunction - // ***************************************************************** - namespace details { - - template - struct select_option - { - typedef void type; - }; - - template