Re: [Boost-bugs] [Boost C++ Libraries] #2457: Compatible Sorting Criteria definition

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2457: Compatible Sorting Criteria definition
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-13 08:28:35


#2457: Compatible Sorting Criteria definition
---------------------------+------------------------------------------------
  Reporter: dave | Owner: joaquin
      Type: Bugs | Status: new
 Milestone: Boost 1.37.0 | Component: multi_index
   Version: Boost 1.36.0 | Severity: Optimization
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment (by joaquin):

 I think a reformulation in terms of partitioning leads to simpler wording
 but provides the user with less insight on what's going on. For instance,
 when defining

 {{{
 template<typename CompatibleKey,typename CompatibleCompare>
 iterator lower_bound(const CompatibleKey& x,const CompatibleCompare&
 comp)const;
 }}}

 if docs merely state that the index has to be partitioned with respect to
 comp(·,x), I don't think the user has a clue from this explanation of how
 (`CompatibleKey`,`CompatibleCompare`) is related to (Key,Compare) (the
 relation being basically that `CompatibleCompare` is a rougher version of
 Compare, i.e. one inducing the same order except for equivalent elements,
 where equivalence classes `CompatibleCompare` are supersets of those of
 Compare.)

 Besides, partitioning jargon is not always //that// simple. Consider for
 instance the standard docs for binary_search:

 //The elements `e` of `[first,last)` are partitioned with respect to the
 expressions `e < value`
 and `!(value < e)` or `comp(e, value)` and `!comp(value, e)`. Also, for
 all elements `e` of `[first, last)`, `e < value` implies `!(value < e)` or
 `comp(e, value)` implies `!comp(value, e)`.//

 So, I'm keeping the original formulation.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2457#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC