The forward iterator for Michael's list has some features:
- it has no post-increment operator
- to protect the value, the iterator contains a GC-specific guard + another guard is required locally for increment operator.
- For some GC (gc::HP, gc::HRC), a guard is limited resource per thread, so an exception (or assertion) "no free guard"
+ For some GC (\p gc::HP), a guard is limited resource per thread, so an exception (or assertion) "no free guard"
may be thrown if a limit of guard count per thread is exceeded.
- The iterator cannot be moved across thread boundary since it contains GC's guard that is thread-private GC data.
- Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent
template <typename K, typename Less>
bool erase_with( K const& key, Less pred )
{
+ CDS_UNUSED( pred );
return erase_at( head(), key, typename maker::template less_wrapper<Less>::type() );
}
template <typename K, typename Less, typename Func>
bool erase_with( K const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return erase_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
template <typename K, typename Less>
bool extract_with( guarded_ptr& dest, K const& key, Less pred )
{
+ CDS_UNUSED( pred );
return extract_at( head(), dest.guard(), key, typename maker::template less_wrapper<Less>::type() );
}
template <typename Q, typename Less>
bool find_with( Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return find_at( head(), key, typename maker::template less_wrapper<Less>::type() );
}
template <typename Q, typename Less, typename Func>
bool find_with( Q const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
template <typename K, typename Less>
bool get_with( guarded_ptr& ptr, K const& key, Less pred )
{
+ CDS_UNUSED( pred );
return get_at( head(), ptr.guard(), key, typename maker::template less_wrapper<Less>::type() );
}