Add equal_to/sort options to nonintrusive trait.
authorMike Krinkin <krinkin.m.u@gmail.com>
Sat, 28 Mar 2015 06:43:31 +0000 (09:43 +0300)
committerMike Krinkin <krinkin.m.u@gmail.com>
Sat, 28 Mar 2015 06:43:31 +0000 (09:43 +0300)
Nonintrusive list uses intrusive list as backend, so it is
required to not break the build.

cds/container/details/lazy_list_base.h

index 74fede7bcbc82cd71340de53e4707a93a29afa42..ad0ad2a8068bb6c742089c75c7c41ddbd1225ce0 100644 (file)
@@ -34,6 +34,20 @@ namespace cds { namespace container {
             */
             typedef opt::none                       less;
 
+            /// Specifies binary functor used for comparing keys for equality
+            /**
+                No default functor is provided. If \p equal_to option is not spcified, \p compare is used, if \p compare is not
+                specified, \p less is used.
+            */
+            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 falsem than lookup operations scan entire list.
+            */
+            static const bool sort = true;
+
             /// Lock type used to lock modifying items
             /**
                 Default is cds::sync::spin
@@ -76,6 +90,9 @@ namespace cds { namespace container {
             - \p opt::compare - key compare 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 compare. Default is \p std::less<T>.
+            - \p opt::equal_to - specifies binary functor for comparing keys for equality. No default is provided. If \p equal_to is
+                not specified, \p compare is used, if \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, \p cds::backoff::Default is used.
             - \p opt::item_counter - the type of item counting feature. Default is disabled (\p atomicity::empty_item_counter).
                 To enable item counting use \p atomicity::item_counter.