From: Mike Krinkin Date: Sat, 28 Mar 2015 06:28:33 +0000 (+0300) Subject: Add equal_to option to intrusive lazy list trait. X-Git-Tag: v2.1.0~293^2^2~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f58ba5954a17ce4af483ac1fa742735392b82fdf;p=libcds.git Add equal_to option to intrusive lazy list trait. Equal functor will be used for unordered lazy list. As comment says, it would be possible to derive equal_to from comparator or less functors. --- diff --git a/cds/intrusive/details/lazy_list_base.h b/cds/intrusive/details/lazy_list_base.h index 8a497c10..bddbd510 100644 --- a/cds/intrusive/details/lazy_list_base.h +++ b/cds/intrusive/details/lazy_list_base.h @@ -208,6 +208,13 @@ namespace cds { namespace intrusive { */ typedef opt::none less; + /// Specifies binary functor used for comparing keys for equality + /** + If \p equal_to option is not specified, \p compare is used, if \p compare is not specified, \p less is used, + if \p less is not specified, then \p std::equal_to is used. + */ + typedef opt::none equal_to; + /// Back-off strategy typedef cds::backoff::Default back_off; @@ -245,6 +252,8 @@ namespace cds { namespace intrusive { - \p opt::compare - key comparison functor. No default functor is provided. If the option is not specified, the \p opt::less is used. - \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less. + - \p opt::equal_to - specifies binary functor for comparing keys for equality. If \p equal_to is not specified, \p compare is + used, \p compare is not specified, \p less is used. - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used. - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. Due the nature of GC schema the disposer may be called asynchronously.