New node was created twice from the arguments by move semantics. However, move semantics may change internal state of the argument. This can lead to an incorrect element in the set and even to an incorrect key that breaks the set logic.
/// Guarded pointer
typedef typename gc::template guarded_ptr< node_type, value_type, details::guarded_ptr_cast_set<node_type, value_type> > guarded_ptr;
- private:
+ protected:
//@cond
static value_type& node_to_value( node_type& n )
{
return n.m_Value;
}
+
static value_type const& node_to_value( node_type const& n )
{
return n.m_Value;
}
- //@endcond
- protected:
- //@cond
template <typename Q>
static node_type * alloc_node( Q const& v )
{
protected:
//@cond
+ bool insert_node( node_type * pNode )
+ {
+ return insert_node_at( head(), pNode );
+ }
+
bool insert_node_at( head_type& refHead, node_type * pNode )
{
assert( pNode != nullptr );
protected:
//@cond
+ static value_type& node_to_value( node_type& n )
+ {
+ return n.m_Value;
+ }
+
static node_type * alloc_node()
{
return cxx_allocator().New();
protected:
//@cond
+ iterator insert_node( node_type * pNode )
+ {
+ return node_to_iterator( insert_node_at( head(), pNode ));
+ }
+
node_type * insert_node_at( head_type& refHead, node_type * pNode )
{
assert( pNode != nullptr );
/// Type of \p get() member function return value
typedef value_type * raw_ptr;
- private:
+ protected:
//@cond
static value_type& node_to_value( node_type& n )
{
return n.m_Value;
}
+
static value_type const& node_to_value( node_type const& n )
{
return n.m_Value;
}
- //@endcond
- protected:
- //@cond
template <typename Q>
static node_type * alloc_node( Q const& v )
{
protected:
//@cond
+ bool insert_node( node_type * pNode )
+ {
+ return insert_node_at( head(), pNode );
+ }
+
bool insert_node_at( head_type& refHead, node_type * pNode )
{
assert( pNode != nullptr );