/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
*/
iterator begin()
{
- iterator it( head() );
+ iterator it( head());
++it ; // skip dummy head node
return it;
}
*/
iterator end()
{
- return iterator( tail() );
+ return iterator( tail());
}
/// Returns a forward const iterator addressing the first element in a list
const_iterator begin() const
{
- const_iterator it( head() );
+ const_iterator it( head());
++it ; // skip dummy head node
return it;
}
/// Returns a forward const iterator addressing the first element in a list
const_iterator cbegin() const
{
- const_iterator it( head() );
+ const_iterator it( head());
++it ; // skip dummy head node
return it;
}
/// Returns an const iterator that addresses the location succeeding the last element in a list
const_iterator end() const
{
- return const_iterator( tail() );
+ return const_iterator( tail());
}
/// Returns an const iterator that addresses the location succeeding the last element in a list
const_iterator cend() const
{
- return const_iterator( tail() );
+ return const_iterator( tail());
}
//@}
template <typename Q>
guarded_ptr extract( Q const& key )
{
- return extract_at( head(), key, intrusive_key_comparator() );
+ return extract_at( head(), key, intrusive_key_comparator());
}
/// Extracts the item from the list with comparing functor \p pred
guarded_ptr extract_with( Q const& key, Less pred )
{
CDS_UNUSED( pred );
- return extract_at( head(), key, typename maker::template less_wrapper<Less>::type() );
+ return extract_at( head(), key, typename maker::template less_wrapper<Less>::type());
}
/// Checks whether the list contains \p key
template <typename Q>
bool contains( Q const& key )
{
- return find_at( head(), key, intrusive_key_comparator() );
+ return find_at( head(), key, intrusive_key_comparator());
}
//@cond
template <typename Q>
bool contains( Q const& key, Less pred )
{
CDS_UNUSED( pred );
- return find_at( head(), key, typename maker::template less_wrapper<Less>::type() );
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type());
}
//@cond
template <typename Q, typename Less>
template <typename Q>
guarded_ptr get( Q const& key )
{
- return get_at( head(), key, intrusive_key_comparator() );
+ return get_at( head(), key, intrusive_key_comparator());
}
/// Finds the key \p key and return the item found
guarded_ptr get_with( Q const& key, Less pred )
{
CDS_UNUSED( pred );
- return get_at( head(), key, typename maker::template less_wrapper<Less>::type() );
+ return get_at( head(), key, typename maker::template less_wrapper<Less>::type());
}
/// Checks whether the list is empty
{
scoped_node_ptr pNode( alloc_node( std::forward<Q>( key )));
- if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ f( node_to_value(node) ); } )) {
+ if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ f( node_to_value(node)); } )) {
pNode.release();
return true;
}
template <typename Q, typename Compare, typename Func>
bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
{
- return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node) ); } );
+ return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node)); } );
}
template <typename Q, typename Compare>