node_type( const value_type& val )
: m_value( val )
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_value( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
typedef typename options::allocator::template rebind<node_type>::other allocator_type;
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * p )
{
node_deallocator()( p );
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
-
/// Dequeues a value using copy functor
/**
: m_val( std::make_pair( key_type(key), mapped_type(v) ))
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
node_type( K&& key, Args&&... args )
: m_val( std::forward<K>(key), std::move( mapped_type(std::forward<Args>(args)...)) )
{}
-# else
- node_type()
- {}
-# endif
};
/*
{
return cxx_node_allocator().New( key );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
static node_type * alloc_node( K&& key, Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<K>( key ), std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
}
return false;
}
-# endif
-
/// Ensures that the \p key exists in the map
/**
: m_val(v)
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_val( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
struct value_accessor {
{
return cxx_node_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-# endif
/// Ensures that the \p val exists in the set
/**
: m_Data( key, value )
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Ky, typename... Args>
node_type( Ky&& key, Args&&... args )
: m_Data( std::forward<Ky>(key), std::move( value_type( std::forward<Args>(args)...)))
{}
-# endif
};
typedef typename original_type_traits::allocator::template rebind<node_type>::other allocator_type;
node_type( Q const& v )
: m_Value(v)
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_Value( std::forward<Args>(args)...)
{}
-# endif
};
typedef typename original_type_traits::allocator::template rebind<node_type>::other allocator_type;
: m_Data( key, value )
{}
-# ifdef CDS_EMPLACE_SUPPORT
template< typename Ky, typename... Args>
node_type( Ky&& key, Args&&... args )
: m_Data( std::forward<Ky>(key), std::move( value_type( std::forward<Args>(args)...)))
{}
-# endif
};
typedef typename original_type_traits::allocator::template rebind<node_type>::other allocator_type;
: m_Value(v)
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_Value( std::forward<Args>(args)... )
{}
-# endif
};
typedef Traits original_type_traits;
init_tower( nHeight, pTower );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
node_type( unsigned int nHeight, atomic_marked_ptr * pTower, Q&& key, Args&&... args )
: m_Value( std::forward<Q>(key), std::move( mapped_type( std::forward<Args>(args)... )))
{
init_tower( nHeight, pTower );
}
-# endif
private:
node_type() ; // no default ctor
key, val
);
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type * New( unsigned int nHeight, Args&&... args )
{
std::forward<Args>(args)...
);
}
-# endif
};
struct node_deallocator {
}
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
node_type( unsigned int nHeight, atomic_marked_ptr * pTower, Q&& q, Args&&... args )
: m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
base_class::make_tower( nHeight, pTower );
}
}
-# endif
private:
node_type() ; // no default ctor
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
}
return false;
}
-# endif
/// Ensures that the \p key exists in the map
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
RCU \p synchronize method can be called. RCU should not be locked.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
}
return false;
}
-# endif
/// Ensures that the \p key exists in the map
/**
return bRes;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-# endif
/// Delete \p key from the set
/** \anchor cds_nonintrusive_EllenBinTreeSet_erase_val
return bRes;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
RCU \p synchronize method can be called. RCU should not be locked.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-# endif
/// Delete \p key from the set
/** \anchor cds_nonintrusive_EllenBinTreeSet_rcu_erase_val
return cxx_allocator().New( key, val );
}
-#ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-#endif
static void free_node( node_type * pNode )
{
return insert_key_at( head(), key, func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Ensures that the \p key exists in the list
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-# endif
template <typename K, typename Compare>
bool erase_at( head_type& refHead, K const& key, Compare cmp )
return cxx_allocator().New( key, val );
}
-#ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-#endif
static void free_node( node_type * pNode )
{
return std::make_pair( node_to_iterator( ret.first ), ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns an iterator pointed to inserted value, or \p end() if inserting is failed
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
{
return node_to_iterator( emplace_at( head(), std::forward<Args>(args)... ));
}
-# endif
/// Find the key \p key
/** \anchor cds_nonintrusive_LazyKVList_nogc_find
return std::make_pair( pItemFound, ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type * emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-#endif
template <typename K, typename Compare>
node_type * find_at( head_type& refHead, const K& key, Compare cmp )
return cxx_allocator().New( key, val );
}
-#ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-#endif
static void free_node( node_type * pNode )
{
return insert_key_at( head(), key, func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function makes RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Ensures that the \p key exists in the list
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-# endif
template <typename K, typename Compare>
bool erase_at( head_type& refHead, K const& key, Compare cmp )
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return insert_at( head(), key, func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Ensures that the \p key exists in the list
/**
return insert_node_at( refHead, alloc_node( val ));
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-# endif
template <typename Q, typename Func>
bool insert_at( head_type& refHead, const Q& key, Func f )
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return node_to_iterator( insert_at( head(), val ) );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Return an iterator pointing to inserted item if success \ref end() otherwise
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
{
return node_to_iterator( emplace_at( head(), std::forward<Args>(args)... ));
}
-# endif
/// Ensures that the item \p val exists in the list
/**
return insert_node_at( refHead, alloc_node( val ));
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type * emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-# endif
+
template <typename Q>
std::pair< node_type *, bool > ensure_at( head_type& refHead, Q const& val )
{
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return insert_at( head(), key, func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function makes RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Ensures that the \p key exists in the list
/**
return insert_node_at( refHead, alloc_node( val ));
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)... ));
}
-# endif
template <typename Q, typename Func>
bool insert_at( head_type& refHead, Q const& key, Func f )
return cxx_allocator().New( key, val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
static node_type * alloc_node( K&& key, Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<K>(key), std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return ensure_at( head(), key, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
return emplace_at( head(), std::forward<K>(key), std::forward<Args>(args)... );
}
-# endif
/// Deletes \p key from the list
/** \anchor cds_nonintrusive_MichaelKVList_hp_erase_val
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace_at( head_type& refHead, K&& key, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<K>(key), std::forward<Args>(args)... ));
}
-# endif
template <typename K, typename Func>
std::pair<bool, bool> ensure_at( head_type& refHead, const K& key, Func f )
return cxx_allocator().New( key, val );
}
-#ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
static node_type * alloc_node( K&& key, Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<K>(key), std::forward<Args>(args)... );
}
-#endif
static void free_node( node_type * pNode )
{
return std::make_pair( node_to_iterator( ret.first ), ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns an iterator pointed to inserted value, or \p end() if inserting is failed
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
iterator emplace( K&& key, Args&&... args )
{
return node_to_iterator( emplace_at( head(), std::forward<K>(key), std::forward<Args>(args)... ));
}
-# endif
/// Find the key \p key
/** \anchor cds_nonintrusive_MichaelKVList_nogc_find
return std::make_pair( pItemFound, ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
node_type * emplace_at( head_type& refHead, K&& key, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<K>(key), std::forward<Args>(args)... ));
}
-#endif
template <typename K, typename Compare>
node_type * find_at( head_type& refHead, K const& key, Compare cmp )
return cxx_allocator().New( key, val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
static node_type * alloc_node( K&& key, Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<K>(key), std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return ensure_at( head(), key, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function makes RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
return emplace_at( head(), std::forward<K>(key), std::forward<Args>(args)... );
}
-# endif
/// Deletes \p key from the list
/** \anchor cds_nonintrusive_MichaelKVList_rcu_erase
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace_at( head_type& refHead, K&& key, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<K>(key), std::forward<Args>(args)... ));
}
-# endif
template <typename K, typename Func>
std::pair<bool, bool> ensure_at( head_type& refHead, const K& key, Func f )
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return ensure_at( head(), key, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Delete \p key from the list
/** \anchor cds_nonintrusive_MichealList_hp_erase_val
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args) ... ));
}
-# endif
template <typename Q, typename Compare, typename Func>
bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return std::make_pair( node_to_iterator( ret.first ), ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Return an iterator pointing to inserted item if success \ref end() otherwise
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
{
return node_to_iterator( emplace_at( head(), std::forward<Args>(args)... ));
}
-# endif
/// Find the key \p val
/** \anchor cds_nonintrusive_MichaelList_nogc_find_val
return std::make_pair( pItemFound, ret.second );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type * emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args)...));
}
-# endif
template <typename Q, typename Compare>
node_type * find_at( head_type& refHead, Q const& key, Compare cmp )
return cxx_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>(args)... );
}
-# endif
static void free_node( node_type * pNode )
{
return ensure_at( head(), key, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function makes RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics.
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return emplace_at( head(), std::forward<Args>(args)... );
}
-# endif
/// Deletes \p key from the list
/** \anchor cds_nonintrusive_MichealList_rcu_erase_val
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace_at( head_type& refHead, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<Args>(args) ... ));
}
-# endif
template <typename Q, typename Compare, typename Func>
bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
return bRet;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \p mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
++m_ItemCounter;
return bRet;
}
-# endif
/// Deletes \p key from the map
/** \anchor cds_nonintrusive_MichaelMap_erase_val
return end();
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns an iterator pointed to inserted value, or \p end() if inserting is failed
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
iterator emplace( K&& key, Args&&... args )
return end();
}
-# endif
/// Ensures that the key \p key exists in the map
/**
return bRet;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- The function applies RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
++m_ItemCounter;
return bRet;
}
-# endif
/// Deletes \p key from the map
/** \anchor cds_nonintrusive_MichaelMap_rcu_erase_val
return bRet;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
++m_ItemCounter;
return bRet;
}
-# endif
/// Deletes \p key from the set
/** \anchor cds_nonintrusive_MichaelSet_erase_val
return end();
}
-#ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Return an iterator pointing to inserted item if success \ref end() otherwise
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
return end();
}
-#endif
/// Ensures that the item \p val exists in the set
/**
return bRet;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function applies RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
++m_ItemCounter;
return bRet;
}
-# endif
/// Deletes \p key from the set
/** \anchor cds_nonintrusive_MichealSet_rcu_erase_val
node_type( const value_type& val )
: m_value( val )
{}
-# ifdef CDS_EMPLACE_SUPPORT
+
template <typename... Args>
node_type( Args&&... args )
: m_value( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
typedef typename options::allocator::template rebind<node_type>::other allocator_type;
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * p )
{
node_deallocator()( p );
return enqueue( data, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
-
/// Synonym for \ref dequeue function
bool pop( value_type& dest )
return false;
}
-#ifdef CDS_EMPLACE_SUPPORT
/// Inserts a item into priority queue
/**
If the priority queue is full, the function returns \p false,
no item has been added.
Otherwise, the function inserts a new item created from \p args arguments
into the heap and returns \p true.
-
- The function is available only for compilers supporting variable template
- and move semantics C++11 feature.
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-#endif
/// Extracts item with high priority
/**
node_type( const value_type& val )
: m_value( val )
{}
-# ifdef CDS_EMPLACE_SUPPORT
+
template <typename... Args>
node_type( Args&&... args )
: m_value( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
typedef typename options::allocator::template rebind<node_type>::other allocator_type;
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * p )
{
node_deallocator()( p );
return dequeue( dest, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Checks if the queue is empty
bool empty() const
node_type( value_type const& val )
: m_value( val )
{}
-# ifdef CDS_EMPLACE_SUPPORT
+
template <typename... Args>
node_type( Args&&... args )
: m_value( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
typedef typename options::allocator::template rebind<node_type>::other allocator_type;
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * p )
{
node_deallocator()( p );
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Dequeues a value using copy functor
/**
: m_pNext( nullptr )
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_pNext( nullptr )
, m_value( std::forward<Args>(args)...)
{}
-# endif
};
//@endcond
return node_allocator().New( data );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return node_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * pNode )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Dequeues a value using copy functor
/**
return cxx_node_allocator().New();
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static value_type * alloc_node_move( Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
struct dummy_disposer {
void operator()( value_type * p )
return enqueue( data, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Removes an element from first segment of the queue
/**
node_type( nHeight, nHeight > 1 ? reinterpret_cast<node_tower_item *>(pMem + c_nNodeSize) : nullptr, v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type * New( unsigned int nHeight, Args&&... args )
{
node_type( nHeight, nHeight > 1 ? reinterpret_cast<node_tower_item *>(pMem + c_nNodeSize) : nullptr,
std::forward<Args>(args)... );
}
-# endif
void Delete( node_type * p )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
}
return false;
}
-# endif
-
/// Ensures that the \p key exists in the map
/**
return it;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
iterator emplace( K&& key, Args&&... args )
{
return base_class::emplace( std::forward<K>(key), std::move(mapped_type(std::forward<Args>(args)...)));
}
-# endif
/// Ensures that the key \p key exists in the map
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
RCU \p synchronize method can be called. RCU should not be locked.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
}
return false;
}
-# endif
-
/// Ensures that the \p key exists in the map
/**
return bRes;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref cds_containewr_SkipListSet_value_type "value_type" constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-# endif
/// Delete \p key from the set
/** \anchor cds_nonintrusive_SkipListSet_erase_val
}
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
node_type( unsigned int nHeight, atomic_ptr * pTower, Q&& q, Args&&... args )
: m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
base_class::make_tower( nHeight, pTower );
}
}
-# endif
- private:
- node_type() ; // no default ctor
+ node_type() = delete; // no default ctor
};
typedef skip_list::details::node_allocator< node_type, type_traits> node_allocator;
return end();
}
-#ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Return an iterator pointing to inserted item if success \ref end() otherwise
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
}
return end();
}
-#endif
/// Ensures that the item \p val exists in the set
/**
return bRes;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
RCU \p synchronize method can be called. RCU should not be locked.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
}
return false;
}
-# endif
/// Delete \p key from the set
/** \anchor cds_nonintrusive_SkipListSet_rcu_erase_val
return base_class::insert( std::make_pair( key, mapped_type() ), func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
return base_class::emplace( std::forward<K>(key), std::move(mapped_type(std::forward<Args>(args)...)));
}
-# endif
-
/// Ensures that the \p key exists in the map
/**
return it;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
iterator emplace( K&& key, Args&&... args )
{
return base_class::emplace( std::forward<K>(key), std::move(mapped_type(std::forward<Args>(args)...)));
}
-# endif
/// Ensures that the key \p key exists in the map
/**
return base_class::insert( std::make_pair( key, mapped_type() ), func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
The function applies RCU lock internally.
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
return base_class::emplace( std::forward<K>(key), std::move(mapped_type(std::forward<Args>(args)...)));
}
-# endif
/// Ensures that the \p key exists in the map
/**
# endif
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \p %value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return insert_node( alloc_node( std::forward<Args>(args)...));
}
-# endif
/// Ensures that the \p item exists in the set
/**
return cxx_node_allocator().New( v );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return insert_node( alloc_node( val ) );
}
-#ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Return an iterator pointing to inserted item if success \ref end() otherwise
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
iterator emplace( Args&&... args )
{
return insert_node( alloc_node( std::forward<Args>(args)... ) );
}
-#endif
/// Ensures that the item \p val exists in the set
/**
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node( Args&&... args )
{
return cxx_node_allocator().MoveNew( std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \p value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
The function applies RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics.
*/
template <typename... Args>
bool emplace( Args&&... args )
{
return insert_node( alloc_node( std::forward<Args>(args)...));
}
-# endif
/// Ensures that the \p item exists in the set
/**
return base_class::insert( key, func );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
return bOk;
}
-# endif
/// Ensures that the \p key exists in the map
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& key, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& key, Func func )
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
bool emplace( Q&& key, Args&&... args )
{
-# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION)
- // GCC < 4.8: std::map has no "emplace" member function. Emulate it
- std::pair<iterator, bool> res = m_Map.insert( value_type( std::forward<Q>(key), mapped_type( std::forward<Args>(args)...)));
-# else
std::pair<iterator, bool> res = m_Map.emplace( std::forward<Q>(key), std::move( mapped_type(std::forward<Args>(args)...)) );
-# endif
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& key, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& key, Func func )
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
bool emplace( Q&& key, Args&&... args )
{
-# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION)
- // GCC < 4.8: std::map has no "emplace" member function. Emulate it
- std::pair<iterator, bool> res = m_Map.insert( value_type( std::forward<Q>(key), mapped_type( std::forward<Args>(args)...)));
-# else
std::pair<iterator, bool> res = m_Map.emplace( std::forward<Q>(key), std::move(mapped_type( std::forward<Args>(args)...)));
-# endif
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& key, Func func )
return bOk;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \p %value_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename... Args>
bool emplace( Args&&... args )
base_class::resize();
return bOk;
}
-# endif
/// Ensures that the \p val exists in the set
/**
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
std::pair<iterator, bool> res = m_Set.emplace( std::forward<Args>(args)... );
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename Q, typename... Args>
bool emplace( Q&& key, Args&&... args )
{
std::pair<iterator, bool> res = m_Map.emplace( std::forward<Q>(key), std::move( mapped_type( std::forward<Args>(args)...)));
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( Q const& val, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Ensures that the \p item exists in the container
/**
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
-# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION)
- // GCC < 4.8: std::set has no "emplace" member function. Emulate it
- std::pair<iterator, bool> res = m_Set.insert( value_type( std::forward<Args>(args)...));
-# else
std::pair<iterator, bool> res = m_Set.emplace( std::forward<Args>(args)... );
-# endif
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return res.second;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
-# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION)
- // GCC < 4.8: std::set has no "emplace" member function. Emulate it
- std::pair<iterator, bool> res = m_Set.insert( value_type( std::forward<Args>(args)...));
-# else
std::pair<iterator, bool> res = m_Set.emplace( std::forward<Args>(args)... );
-# endif
return res.second;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
node_type( const value_type& val )
: m_value( val )
{}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
node_type( Args&&... args )
: m_value( std::forward<Args>(args)...)
{}
-# else
- node_type()
- {}
-# endif
};
typedef typename options::allocator::template rebind<node_type>::other allocator_type;
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static node_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( node_type * p )
{
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
- /// Pushes data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
+ /// Pushes data of type \ref value_type created from <tt>std::forward<Args>(args)...</tt>
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Pop an item from the stack
/**
{
return cxx_allocator().New( val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
static value_type * alloc_node_move( Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<Args>( args )... );
}
-# endif
static void free_node( value_type * p )
{
node_deallocator()( p );
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
/// Dequeues a value using copy functor
/**
# endif
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Enqueues data of type \ref cds_container_VyukovMPMCCycleQueue_value_type "value_type" constructed with <tt>std::forward<Args>(args)...</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
bool emplace( Args&&... args )
{
++m_ItemCounter;
return true;
-
}
-# endif
/// Dequeues an item from queue
/** @anchor cds_container_VyukovMPMCCycleQueue_dequeue_func
return Construct( allocator_type::allocate(1), src... );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Analogue of <tt>operator new T( std::forward<Args>(args)... )</tt> (move semantics)
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
value_type * MoveNew( Args&&... args )
{
return MoveConstruct( allocator_type::allocate(1), std::forward<Args>(args)... );
}
-# endif
-
/// Analogue of operator new T[\p nCount ]
value_type * NewArray( size_t nCount )
return new( p ) value_type( src... );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Analogue of placement <tt>operator new( p ) T( std::forward<Args>(args)... )</tt>
- /**
- This function is available only for compiler that supports
- variadic template and move semantics
- */
template <typename... Args>
value_type * MoveConstruct( void * p, Args&&... args )
{
return new( p ) value_type( std::forward<Args>(args)... );
}
-# endif
/// Rebinds allocator to other type \p Q instead of \p T
template <typename Q>
# define CDS_NOEXCEPT_DEFAULTED_(expr) CDS_NOEXCEPT_( expr )
#endif
-#define CDS_EMPLACE_SUPPORT
-
#ifdef CDS_CXX11_INLINE_NAMESPACE_SUPPORT
# define CDS_CXX11_INLINE_NAMESPACE inline
#else
CDS_ATOMIC=std \
CDS_DELETE_SPECIFIER="=delete"\
CDS_DEFAULT_SPECIFIER="=default" \
- CDS_EMPLACE_SUPPORT \
CDS_DECL_OPTIONS="typename... Options" \
CDS_DECL_OPTIONS1="typename... Options" \
CDS_DECL_OPTIONS2="typename... Options" \
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-
-# endif
}
template <class Map>
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-
-# endif
}
CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
CPPUNIT_ASSERT( m.find_with(120, less()) == m.find(120) );
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
it = m.emplace( 151 ) ; // key = 151, val = 0
CPPUNIT_ASSERT( it != m.end() );
CPPUNIT_ASSERT( it != m.end() );
CPPUNIT_ASSERT( it->first == 151 );
CPPUNIT_ASSERT( it->second.m_val == 0 );
-# endif
}
// iterator test
CPPUNIT_ASSERT( it != m.end() );
CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
it = m.emplace( 151 ) ; // key = 151, val = 0
CPPUNIT_ASSERT( it != m.end() );
CPPUNIT_ASSERT( it != m.end() );
CPPUNIT_ASSERT( it->first == 151 );
CPPUNIT_ASSERT( it->second.m_val == 0 );
-# endif
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-
-# endif
}
template <class Map>
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-
-# endif
}
template <class Map>
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
{
int i;
// insert test
l.clear();
CPPUNIT_ASSERT( l.empty() );
}
-#endif
// Iterator test
{
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
-
}
void HP_cmp();
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) );
CPPUNIT_ASSERT( l.emplace( 251, 152 ));
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
// Iterator test
{
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
// Iterator test
{
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
{
int i;
l.clear();
CPPUNIT_ASSERT( l.empty() );
}
-#endif
// Iterator test
{
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) != l.end() );
CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
}
void HP_cmp();
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) );
CPPUNIT_ASSERT( l.emplace( 251, 152 ));
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
// Iterator test
{
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#ifdef CDS_EMPLACE_SUPPORT
// insert test
CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
l.clear();
CPPUNIT_ASSERT( l.empty() );
-#endif
// Iterator test
{
// Push test
for ( value_type * p = pFirst; p < pLast; ++p ) {
-#ifdef CDS_EMPLACE_SUPPORT
switch ( pq.size() & 3 ) {
case 1:
CPPUNIT_ASSERT( pq.emplace( p->k, p->v ));
default:
CPPUNIT_ASSERT( pq.push( *p ));
}
-#else
- CPPUNIT_ASSERT( pq.push( *p ));
-#endif
CPPUNIT_ASSERT( !pq.empty() );
CPPUNIT_ASSERT( pq.size() == ++nSize );
}
}
//emplace
-# ifdef CDS_EMPLACE_SUPPORT
{
size_t nMajor = 0;
size_t nMinor = 0;
CPPUNIT_CHECK( q.empty() );
CPPUNIT_CHECK( misc::check_size( q, 0 ));
}
-# endif
// pop from empty queue
{
template <class Queue>
void test_emplace( Queue& q )
{
-# ifdef CDS_EMPLACE_SUPPORT
int it;
for ( size_t i = 0; i < 3; ++i ) {
CPPUNIT_ASSERT( q.emplace( static_cast<int>( i * 42 )) );
CPPUNIT_ASSERT( it == static_cast<int>( i * 42 ));
CPPUNIT_ASSERT( q.empty() );
}
-# endif
}
template <class Queue>
template <class Queue>
void test_emplace_ic( Queue& q )
{
-# ifdef CDS_EMPLACE_SUPPORT
int it = 0;
for ( size_t i = 0; i < 3; ++i ) {
CPPUNIT_ASSERT( q.emplace( (int) i * 10 ) );
CPPUNIT_ASSERT( q.empty() );
CPPUNIT_ASSERT( q.size() == 0 );
}
-# endif
}
public:
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151
CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# endif
}
template <class Set, class Predicate>
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151
CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# endif
}
CPPUNIT_ASSERT( it->key() == 50 );
CPPUNIT_ASSERT( it->val() == 25 );
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
it = s.emplace( 151 ) ; // key = 151, val = 151
CPPUNIT_ASSERT( it != s.end() );
CPPUNIT_ASSERT( it != s.end() );
CPPUNIT_ASSERT( it->key() == 151 );
CPPUNIT_ASSERT( it->val() == 151 );
-# endif
//s.clear();
//CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( it->key() == 50 );
CPPUNIT_ASSERT( it->val() == 25 );
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
it = s.emplace( 151 ) ; // key = 151, val = 151
CPPUNIT_ASSERT( it != s.end() );
CPPUNIT_ASSERT( it != s.end() );
CPPUNIT_ASSERT( it->key() == 151 );
CPPUNIT_ASSERT( it->val() == 151 );
-# endif
CPPUNIT_ASSERT( !s.empty() );
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151
CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# endif
}
template <class Set>
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151
CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# endif
}
void Striped_list();
CPPUNIT_ASSERT( stack.push(30));
CPPUNIT_ASSERT( !stack.empty());
-#ifdef CDS_EMPLACE_SUPPORT
CPPUNIT_ASSERT( stack.emplace(100));
CPPUNIT_ASSERT( stack.pop(v));
CPPUNIT_ASSERT( v == 100 );
-#endif
stack.clear();
CPPUNIT_ASSERT( stack.empty() );
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
m.clear();
CPPUNIT_ASSERT( m.empty() );
CPPUNIT_ASSERT( check_size( m, 0 ));
-# endif
}
template <typename Map>
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# ifdef CDS_EMPLACE_SUPPORT
// emplace test
CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 1510
CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
s.clear();
CPPUNIT_ASSERT( s.empty() );
CPPUNIT_ASSERT( check_size( s, 0 ));
-# endif
}
template <typename Set>