};
typedef typename opt::details::make_comparator< key_type, original_type_traits >::type key_comparator;
+ typedef typename opt::details::make_equal_to< key_type, original_type_traits >::type equal_to_comparator;
template <typename Less>
struct less_wrapper {
typedef intrusive::lazy_list::base_hook< opt::gc<gc> > hook;
typedef node_deallocator disposer;
typedef cds::details::compare_wrapper< node_type, key_comparator, key_field_accessor > compare;
+ typedef cds::details::predicate_wrapper< node_type, equal_to_comparator, key_field_accessor > equal_to;
static const opt::link_check_type link_checker = cds::intrusive::lazy_list::traits::link_checker;
};
};
typedef typename opt::details::make_comparator< value_type, original_type_traits >::type key_comparator;
+ typedef typename opt::details::make_equal_to< value_type, original_type_traits >::type equal_to_comparator;
struct value_accessor {
value_type const & operator()( node_type const & node ) const
static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::lazy_list::traits::link_checker;
typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
+ typedef cds::details::predicate_wrapper< node_type, equal_to_comparator, value_accessor > equal_to;
};
typedef intrusive::LazyList<gc, node_type, intrusive_traits> type;
//@endcond
public:
+ typedef Traits traits;
typedef cds::gc::nogc gc; ///< Garbage collector
#ifdef CDS_DOXYGEN_INVOKED
typedef Key key_type ; ///< Key type
protected:
//@cond
- typedef typename base_class::value_type node_type;
- typedef typename maker::cxx_allocator cxx_allocator;
- typedef typename maker::node_deallocator node_deallocator;
- typedef typename maker::intrusive_traits::compare intrusive_key_comparator;
- typedef typename base_class::node_type head_type;
+ typedef typename base_class::value_type node_type;
+ typedef typename maker::cxx_allocator cxx_allocator;
+ typedef typename maker::node_deallocator node_deallocator;
+ typedef typename base_class::predicate_type intrusive_predicate_type;
+ typedef typename base_class::node_type head_type;
//@endcond
protected:
template <typename Q>
iterator find( Q const& key )
{
- return node_to_iterator( find_at( head(), key, intrusive_key_comparator() ) );
+ return node_to_iterator( find_at( head(), key, intrusive_predicate_type() ) );
}
/// Finds the key \p val using \p pred predicate for searching
\p Less functor has the interface like \p std::less.
\p pred must imply the same element order as the comparator used for building the list.
*/
- template <typename Q, typename Less>
- iterator find_with( Q const& key, Less pred )
+ template <typename Q, typename Less, bool Sort = traits::sort>
+ typename std::enable_if<Sort, iterator>::type find_with( Q const& key, Less pred )
{
CDS_UNUSED( pred );
return node_to_iterator( find_at( head(), key, typename maker::template less_wrapper<Less>::type() ) );
typedef T value_type; ///< Type of value stored in the list
typedef Traits traits; ///< List traits
- typedef typename base_class::back_off back_off; ///< Back-off strategy used
- typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes
- typedef typename base_class::item_counter item_counter; ///< Item counting policy used
- typedef typename maker::key_comparator key_comparator; ///< key comparison functor
- typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option
+ typedef typename base_class::back_off back_off; ///< Back-off strategy used
+ typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes
+ typedef typename base_class::item_counter item_counter; ///< Item counting policy used
+ typedef typename maker::key_comparator key_comparator; ///< key comparison functor
+ typedef typename maker::equal_to_comparator equal_to_comparator; ///< key equality comparision functor
+ typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option
protected:
//@cond
- typedef typename base_class::value_type node_type;
- typedef typename maker::cxx_allocator cxx_allocator;
- typedef typename maker::node_deallocator node_deallocator;
- typedef typename maker::intrusive_traits::compare intrusive_key_comparator;
+ typedef typename base_class::value_type node_type;
+ typedef typename maker::cxx_allocator cxx_allocator;
+ typedef typename maker::node_deallocator node_deallocator;
+ typedef typename base_class::predicate_type intrusive_predicate_type;
typedef typename base_class::node_type head_type;
//@endcond
template <typename Q>
iterator find( Q const& key )
{
- return node_to_iterator( find_at( head(), key, intrusive_key_comparator() ));
+ return node_to_iterator( find_at( head(), key, intrusive_predicate_type() ));
}
/// Finds the key \p val using \p pred predicate for searching
\p Less functor has the interface like \p std::less.
\p pred must imply the same element order as the comparator used for building the list.
*/
- template <typename Q, typename Less>
- iterator find_with( Q const& key, Less pred )
+ template <typename Q, typename Less, bool Sort = traits::sort>
+ typename std::enable_if<Sort, iterator>::type find_with( Q const& key, Less pred )
{
CDS_UNUSED( pred );
return node_to_iterator( find_at( head(), key, typename maker::template less_wrapper<Less>::type() ));