// Lambda
#define CDS_CXX11_LAMBDA_SUPPORT
-// RValue
-#define CDS_RVALUE_SUPPORT
-#define CDS_MOVE_SEMANTICS_SUPPORT
-
#define CDS_CONSTEXPR constexpr
#define CDS_CONSTEXPR_CONST constexpr const
/*
Required C++11 features:
+ - move semantics [CDS_RVALUE_SUPPORT, CDS_MOVE_SEMANTICS_SUPPORT]
- variadic template [CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT]
- template alias [CDS_CXX11_TEMPLATE_ALIAS_SUPPORT]
- explicit conversion operator [CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT]
// ***************************************
// C++11 features
-// RValue
-#define CDS_RVALUE_SUPPORT
-#define CDS_MOVE_SEMANTICS_SUPPORT
-
// C++11 inline namespace
#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
// Lambda (ICL 12 +)
#define CDS_CXX11_LAMBDA_SUPPORT
-// RValue (ICL 10+)
-#define CDS_RVALUE_SUPPORT
-#define CDS_MOVE_SEMANTICS_SUPPORT
-
// C++11 inline namespace
#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
// Lambda (VC 10 +)
#define CDS_CXX11_LAMBDA_SUPPORT
-// RValue (VC 10+)
-#define CDS_RVALUE_SUPPORT
-#define CDS_MOVE_SEMANTICS_SUPPORT
-
// C++11 inline namespace
//#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
: base_class( nInitialSize, nProbesetSize, nProbesetThreshold, h )
{}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Constructs a map with given hash functor tuple (move semantics)
/**
The probe set size and threshold are set as default, see CuckooSet()
)
: base_class( nInitialSize, nProbesetSize, nProbesetThreshold, std::forward<hash_tuple_type>(h) )
{}
-# endif // ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Destructor clears the map
~CuckooMap()
: base_class( nInitialSize, nProbesetSize, nProbesetThreshold, h )
{}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Constructs the set object with given hash functor tuple (move semantics)
/**
The probe set size and threshold are set as default, see CuckooSet()
)
: base_class( nInitialSize, nProbesetSize, nProbesetThreshold, std::forward<hash_tuple_type>(h) )
{}
-# endif // ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Destructor clears the set
~CuckooSet()
: m_Value( args... )
{}
-#ifdef CDS_RVALUE_SUPPORT
/// Move constructor
template <typename... Args>
node( Args&&... args)
: m_Value( std::forward<Args>(args)... )
{}
-#endif // CDS_RVALUE_SUPPORT
};
/// EllenBinTreeMap leaf node
return true;
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Inserts a new element at the beginning of the deque container (move semantics)
/**
The function always returns \p true
m_FlatCombining.internal_statistics().onPushFrontMove();
return true;
}
-# endif
/// Inserts a new element at the end of the deque container
/**
return true;
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Inserts a new element at the end of the deque container (move semantics)
/**
The function always returns \p true
m_FlatCombining.internal_statistics().onPushBackMove();
return true;
}
-# endif
/// Removes the first element in the deque container
/**
assert( pRec->pValPush );
m_Deque.push_front( *(pRec->pValPush) );
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_front_move:
assert( pRec->pValPush );
m_Deque.push_front( std::move( *(pRec->pValPush )) );
break;
-# endif
case op_push_back:
assert( pRec->pValPush );
m_Deque.push_back( *(pRec->pValPush) );
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_back_move:
assert( pRec->pValPush );
m_Deque.push_back( std::move( *(pRec->pValPush )) );
break;
-# endif
case op_pop_front:
assert( pRec->pValPop );
pRec->bEmpty = m_Deque.empty();
return true;
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Inserts a new element in the priority queue (move semantics)
/**
The function always returns \p true
m_FlatCombining.internal_statistics().onPushMove();
return true;
}
-# endif
/// Removes the top element from priority queue
/**
assert( pRec->pValPush );
m_PQueue.push( *(pRec->pValPush) );
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_move:
assert( pRec->pValPush );
m_PQueue.push( std::move( *(pRec->pValPush )) );
break;
-# endif
case op_pop:
assert( pRec->pValPop );
pRec->bEmpty = m_PQueue.empty();
return enqueue( val );
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Inserts a new element at the end of the queue (move semantics)
/**
\p val is moved to inserted element
{
return enqueue( val );
}
-# endif
/// Removes the next element from the queue
/**
assert( pRec->pValEnq );
m_Queue.push( *(pRec->pValEnq ) );
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_enq_move:
assert( pRec->pValEnq );
m_Queue.push( std::move( *(pRec->pValEnq )) );
break;
-# endif
case op_deq:
assert( pRec->pValDeq );
pRec->bEmpty = m_Queue.empty();
goto collided;
}
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_enq_move:
if ( rec2.op() == op_deq ) {
assert(rec1.pValEnq);
goto collided;
}
break;
-# endif
case op_deq:
switch ( rec2.op() ) {
case op_enq:
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_enq_move:
-# endif
return collide( rec2, rec1 );
}
}
return true;
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Inserts a new element at the top of stack (move semantics)
/**
The content of the new element initialized to a copy of \p val.
m_FlatCombining.internal_statistics().onPushMove();
return true;
}
-# endif
/// Removes the element on top of the stack
/**
assert( pRec->pValPush );
m_Stack.push( *(pRec->pValPush ) );
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_move:
assert( pRec->pValPush );
m_Stack.push( std::move( *(pRec->pValPush )) );
break;
-# endif
case op_pop:
assert( pRec->pValPop );
pRec->bEmpty = m_Stack.empty();
goto collided;
}
break;
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_move:
if ( rec2.op() == op_pop ) {
assert(rec1.pValPush);
goto collided;
}
break;
-# endif
case op_pop:
switch ( rec2.op() ) {
case op_push:
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
case op_push_move:
-# endif
return collide( rec2, rec1 );
}
}
) : base_class( nCapacity, resizingPolicy )
{}
-#ifdef CDS_RVALUE_SUPPORT
/// Ctor with resizing policy (move semantics)
/**
This constructor initializes m_ResizingPolicy member moving \p resizingPolicy parameter
,resizing_policy&& resizingPolicy ///< Resizing policy
) : base_class( nCapacity, std::forward<resizing_policy>(resizingPolicy) )
{}
-#endif
/// Destructor destroys internal data
~StripedMap()
: public details::boost_map_copy_policies<boost::container::flat_map< Key, T, Traits, Alloc > >::swap_item_policy
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::container::flat_map< Key, T, Traits, Alloc > >
: public details::boost_map_copy_policies<boost::container::flat_map< Key, T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename K, typename T, typename Alloc>
struct move_item_policy< boost::container::list< std::pair< K const, T >, Alloc > >
list.insert( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds:container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
: public details::boost_map_copy_policies<boost::container::map< Key, T, Traits, Alloc > >::swap_item_policy
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::container::map< Key, T, Traits, Alloc > >
: public details::boost_map_copy_policies<boost::container::map< Key, T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename K, typename T, typename Alloc>
struct move_item_policy< boost::container::slist< std::pair< K const, T >, Alloc > >
list.insert_after( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds:container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
template <typename Q>
: public details::boost_map_copy_policies<boost::unordered_map< Key, T, Traits, Alloc > >::swap_item_policy
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::unordered_map< Key, T, Traits, Alloc > >
: public details::boost_map_copy_policies<boost::unordered_map< Key, T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Hash, typename Pred, typename Alloc>
struct move_item_policy< std::unordered_map< Key, T, Hash, Pred, Alloc > >
map.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Traits, typename Alloc>
struct move_item_policy< stdext::hash_map< Key, T, Traits, Alloc > >
map.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename K, typename T, typename Alloc>
struct move_item_policy< std::list< std::pair< K const, T >, Alloc > >
list.insert( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds:container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for map
template <typename Key, typename T, typename Traits, typename Alloc>
struct move_item_policy< std::map< Key, T, Traits, Alloc > >
map.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
) : base_class( nCapacity, resizingPolicy )
{}
-#ifdef CDS_RVALUE_SUPPORT
/// Ctor with resizing policy (move semantics)
/**
This constructor initializes m_ResizingPolicy member moving \p resizingPolicy parameter
,resizing_policy&& resizingPolicy ///< Resizing policy
) : base_class( nCapacity, std::forward<resizing_policy>(resizingPolicy) )
{}
-#endif
/// Destructor destroys internal data
~StripedSet()
template <typename Container>
struct swap_item_policy;
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
struct move_item ; // move_item_policy tag
template <typename Container>
struct move_item_policy;
-#else
- typedef copy_item move_item ; // if move semantics is not supported, move_item is synonym for copy_item
-#endif
//@endcond
#ifdef CDS_DOXYGEN_INVOKED
typedef copy_item_policy swap_item_policy;
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
struct move_item_policy
{
typedef Set set_type;
set.insert( std::move( *itWhat ) );
}
};
-#endif
};
template <class Set, CDS_SPEC_OPTIONS>
>::copy_policy
, cds::container::striped_set::copy_item, copy_item_policy<container_type>
, cds::container::striped_set::swap_item, swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, move_item_policy<container_type>
-#endif
>::type copy_item;
private:
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
struct move_item_policy {
typedef Map map_type;
typedef typename map_type::value_type pair_type;
map.insert( std::move( *itWhat ) );
}
};
-#endif
};
template <class Map, CDS_SPEC_OPTIONS>
>::copy_policy
, cds::container::striped_set::copy_item, copy_item_policy<container_type>
, cds::container::striped_set::swap_item, swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, move_item_policy<container_type>
-#endif
>::type copy_item;
private:
: public details::boost_set_copy_policies< boost::container::flat_set< T, Traits, Alloc > >::swap_item_policy
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::flat_set
template <typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::container::flat_set< T, Traits, Alloc > >
: public details::boost_set_copy_policies< boost::container::flat_set< T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::list
template <typename T, typename Alloc>
struct move_item_policy< boost::container::list< T, Alloc > >
list.insert( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
// Swap policy is not defined for boost::container::set
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::set
template <typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::container::set< T, Traits, Alloc > >
: public details::boost_set_copy_policies< boost::container::set< T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::slist
template <typename T, typename Alloc>
struct move_item_policy< boost::container::slist< T, Alloc > >
list.insert_after( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
template <typename Q>
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::stable_vector
template <typename T, typename Alloc>
struct move_item_policy< boost::container::stable_vector< T, Alloc > >
vec.insert( itInsert, std::move( *itWhat ));
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
: public details::boost_set_copy_policies< boost::unordered_set< T, Traits, Alloc > >::swap_item_policy
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::unordered_set
template <typename T, typename Traits, typename Alloc>
struct move_item_policy< boost::unordered_set< T, Traits, Alloc > >
: public details::boost_set_copy_policies< boost::unordered_set< T, Traits, Alloc > >::move_item_policy
{};
-#endif
} // namespace striped_set
}} // namespace cds::container
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for boost::container::vector
template <typename T, typename Alloc>
struct move_item_policy< boost::container::vector< T, Alloc > >
vec.insert( itInsert, std::move( *itWhat ));
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
struct swap_item_policy< std::unordered_set< T, Hash, Pred, Alloc > >: public copy_item_policy< std::unordered_set< T, Hash, Pred, Alloc > >
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for std::unordered_set
template <typename T, typename Hash, typename Pred, typename Alloc>
struct move_item_policy< std::unordered_set< T, Hash, Pred, Alloc > >
set.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type> // not defined
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
struct swap_item_policy< stdext::hash_set< T, Traits, Alloc > >: public copy_item_policy< stdext::hash_set< T, Traits, Alloc > >
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for stdext::hash_set
template <typename T, typename Hash, typename Pred, typename Alloc>
struct move_item_policy< stdext::hash_set< T, Traits, Alloc > >
set.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type> // not defined
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for std::list
template <typename T, typename Alloc>
struct move_item_policy< std::list< T, Alloc > >
list.insert( itInsert, std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
struct swap_item_policy< std::set< T, Traits, Alloc > >: public copy_item_policy< std::set< T, Traits, Alloc > >
{};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for std::set
template <typename T, typename Traits, typename Alloc>
struct move_item_policy< std::set< T, Traits, Alloc > >
set.insert( std::move( *itWhat ) );
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
//@endcond
}
};
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
// Move policy for std::vector
template <typename T, typename Alloc>
struct move_item_policy< std::vector< T, Alloc > >
vec.insert( itInsert, std::move( *itWhat ));
}
};
-#endif
} // namespace striped_set
}} // namespace cds::container
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
, cds::container::striped_set::swap_item, cds::container::striped_set::swap_item_policy<container_type>
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
, cds::container::striped_set::move_item, cds::container::striped_set::move_item_policy<container_type>
-#endif
>::type copy_item;
struct find_predicate
# define CDS_NOEXCEPT_DEFAULTED_(expr) CDS_NOEXCEPT_( expr )
#endif
-#if defined(CDS_MOVE_SEMANTICS_SUPPORT)
-# define CDS_EMPLACE_SUPPORT
-#endif
+#define CDS_EMPLACE_SUPPORT
#ifdef CDS_CXX11_INLINE_NAMESPACE_SUPPORT
# define CDS_CXX11_INLINE_NAMESPACE inline
marked_ptr( marked_ptr const& src ) CDS_NOEXCEPT_DEFAULTED = default;
/// Copy-assignment operator
marked_ptr& operator =( marked_ptr const& p ) CDS_NOEXCEPT_DEFAULTED = default;
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+# if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
//@cond
marked_ptr( marked_ptr&& src ) CDS_NOEXCEPT_DEFAULTED = default;
marked_ptr& operator =( marked_ptr&& p ) CDS_NOEXCEPT_DEFAULTED = default;
allocate_bucket_tables( nInitialSize ? cds::beans::ceil2( nInitialSize ) : c_nDefaultInitialSize );
}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Constructs the set object with given hash functor tuple (move semantics)
/**
The probe set size and threshold are set as default, see CuckooSet()
allocate_bucket_tables( nInitialSize ? cds::beans::ceil2( nInitialSize ) : c_nDefaultInitialSize );
}
-# endif // ifdef CDS_MOVE_SEMANTICS_SUPPORT
/// Destructor
~CuckooSet()
alloc_bucket_table( m_nBucketMask + 1 );
}
-#ifdef CDS_RVALUE_SUPPORT
/// Ctor with resizing policy (move semantics)
/**
This constructor initializes m_ResizingPolicy member moving \p resizingPolicy parameter
- Move semantics is used. Available only for the compilers that supports C++11 rvalue reference.
+ Move semantics is used.
*/
StripedSet(
size_t nCapacity ///< Initial size of bucket table and lock array. Must be power of two, the minimum is 16.
: m_Buckets( nullptr )
, m_nBucketMask( ( nCapacity ? calc_init_capacity(nCapacity) : c_nMinimalCapacity ) - 1 )
, m_MutexPolicy( m_nBucketMask + 1 )
- , m_ResizingPolicy( resizingPolicy )
+ , m_ResizingPolicy( std::forward<resizing_policy>( resizingPolicy ) )
{
alloc_bucket_table( m_nBucketMask + 1 );
}
: m_nLoadFactor( src.m_nLoadFactor )
{}
-# ifdef CDS_RVALUE_SUPPORT
- /// Move ctor (for the compilers supporting rvalue reference)
+ /// Move ctor
load_factor_resizing( load_factor_resizing&& src )
: m_nLoadFactor( src.m_nLoadFactor )
{}
-# endif
/// Main policy operator returns \p true when resizing is needed
template <typename Container, typename Bucket>
: m_nThreshold( src.m_nThreshold )
{}
-# ifdef CDS_RVALUE_SUPPORT
- /// Move ctor (for the compilers supporting rvalue reference)
+ /// Move ctor
single_bucket_size_threshold( single_bucket_size_threshold&& src )
: m_nThreshold( src.m_nThreshold )
{}
-# endif
/// Main policy operator returns \p true when resizing is needed
template <typename Container, typename Bucket>
: m_nMask( src.m_nMask )
{}
-# ifdef CDS_RVALUE_SUPPORT
/// Move constructor
pow2_select_policy( pow2_select_policy&& src )
: m_nMask( src.m_nMask )
{}
-# endif
/// Returns <tt>nWhat & (nPow2 - 1)</tt>
size_t operator()( size_t nWhat, size_t ) const
m_arrLocks = create_lock_array( m_nCapacity );
}
-# ifdef CDS_RVALUE_SUPPORT
/// Constructs array of lock and move cell selection policy
/**
Allocates the array and initializes all locks as unlocked.
{
m_arrLocks = create_lock_array( m_nCapacity );
}
-# endif
/// Destructs array of locks and frees used memory
~array()
active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
active_tag& operator=(active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+# if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
# endif
active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
active_tag& operator=(active_tag const&) CDS_NOEXCEPT_DEFAULTED = default;
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+# if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
# endif
return size_t(-1) / sizeof(value_type);
}
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT)
template <class U, class... Args>
void construct(U* p, Args&&... args)
{
new((void *)p) U( std::forward<Args>(args)...);
}
-# else
- template <typename Arg>
- void construct(pointer p, Arg const& val )
- {
- new((void *) p) value_type(val);
- }
-# endif
+
template <class U>
void destroy(U* p)
{
hash_list( hash_tuple_type const& t)
: hash_tuple( t )
{}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
hash_list( hash_tuple_type&& t)
: hash_tuple( std::forward<hash_tuple_type>(t) )
{}
-# endif
template <size_t I, typename T>
typename std::enable_if< (I == sizeof...(Functors)) >::type apply( size_t * dest, T const& v ) const
hash_list_wrapper( hash_tuple_type const& t)
: m_wrappedList( t )
{}
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
hash_list_wrapper( hash_tuple_type&& t)
: m_wrappedList( std::forward<hash_tuple_type>(t) )
{}
-# endif
void operator()( size_t * dest, wrapped_type const& what ) const
{
CDS_CXX11_INLINE_NAMESPACE_SUPPORT \
CDS_CXX11_INLINE_NAMESPACE=inline \
CDS_CXX11_DECLTYPE_SUPPORT \
- CDS_RVALUE_SUPPORT \
- CDS_MOVE_SEMANTICS_SUPPORT \
CDS_NOEXCEPT=noexcept() \
CDS_CONSTEXPR=constexpr \
CDS_ATOMIC=std \
: m_val( n )
{}
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
value_type( value_type&& v )
: m_val( v.m_val )
{}
m_val = v.m_val;
return *this;
}
-#endif
};
typedef std::pair<key_type const, value_type> pair_type;
: m_val( n )
{}
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
value_type( value_type&& v )
: m_val( v.m_val )
{}
m_val = v.m_val;
return *this;
}
-#endif
};
typedef std::pair<key_type const, value_type> pair_type;
: m_val( n )
{}
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
value_type( value_type&& v )
: m_val( v.m_val )
{}
m_val = v.m_val;
return *this;
}
-#endif
};
typedef std::pair<key_type const, value_type> pair_type;
return *this;
}
-
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
item( item&& i )
: nKey( i.nKey )
, nVal( i.nVal )
{}
-#endif
int key() const
{
return *this;
}
-
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
item( item&& i )
: nKey( i.nKey )
, nVal( i.nVal )
// nVal = i.nVal;
// return *this;
//}
-#endif
int key() const
{
return *this;
}
-
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
item( item&& i )
: nKey( i.nKey )
, nVal( i.nVal )
// nVal = i.nVal;
// return *this;
//}
-#endif
int key() const
{
: nVal( v.nVal )
{}
-#ifdef CDS_MOVE_SEMANTICS_SUPPORT
value_type( value_type&& v )
: nVal( v.nVal )
{}
-#endif
value_type& operator=( int n )
{
{}
# ifdef _DEBUG
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
base_hook_value( base_hook_value&& s )
: Hook()
, nKey(s.nKey)
, nValue(s.nValue)
{}
-# endif
base_hook_value& operator=( base_hook_value const& s )
{
nKey = s.nKey;
, nValue(val)
{}
# ifdef _DEBUG
-# ifdef CDS_MOVE_SEMANTICS_SUPPORT
member_hook_value( member_hook_value&& s )
: nKey(s.nKey)
, nValue(s.nValue)
, hook()
{}
-# endif
member_hook_value& operator=( member_hook_value const& s )
{
nKey = s.nKey;