From: Mike Krinkin Date: Sat, 28 Mar 2015 06:36:41 +0000 (+0300) Subject: Add sort policy to intrusive lazy list trait. X-Git-Tag: v2.1.0~293^2^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fd030a874cef7be57ae4d0809839ac44348341f5;p=libcds.git Add sort policy to intrusive lazy list trait. Boolean sort flag indicates whether list is ordered or unordered. Default value is false, so, by default, intrusive lazy list is unordered. --- diff --git a/cds/intrusive/details/lazy_list_base.h b/cds/intrusive/details/lazy_list_base.h index bddbd510..bc6ff520 100644 --- a/cds/intrusive/details/lazy_list_base.h +++ b/cds/intrusive/details/lazy_list_base.h @@ -215,6 +215,13 @@ namespace cds { namespace intrusive { */ typedef opt::none equal_to; + /// Specifies list ordering policy + /** + If \p sort is \p true, than list maintains items in sorted order, otherwise items are unordered. Default is \p true. + Note that if \p sort is \p false, than lookup operations scan entire list. + */ + static const bool sort = true; + /// Back-off strategy typedef cds::backoff::Default back_off; @@ -254,6 +261,7 @@ namespace cds { namespace intrusive { - \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::sort - specifies ordering policy. Default value is \p true. - \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.