Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-04-24 23:05:24


On Sun, Apr 25, 2004 at 03:54:31AM +0200, JOAQUIN LOPEZ MU?Z wrote:
> > that if you call these two object "k" and "t" (key and tuple),
> > then you should have
> > k < t false
> > t < k false
> > t == k does not compile
> > That's just my quick hunch based on what I've quoted above; I haven't
> > considered what consequences it has for the library, but that's my
> > intuitive notion of how tuples as "partial keys" ought to work.
>
> I guess I agree with you, but I wanted to bring this
> in to the list to gather some opinions. Following your
> approach, what should we do with
>
> k <= t
> t <= k
>
> The options are:
>
> a. they hold true
> b. they do not compile
>
> I don't have any strong argument in favor of any option.

If there are other std:: or boost:: types which model the
StrictWeakOrdering concept (without having total orders), I would see
what they do and follow their lead.

If not, I would make the "<=" operators not compile, since
   k <= t
can always be rewritten by clients as
   !(t < k)
and the narrower interface reduces the likelihood of someone mistakenly
getting the impression that there's a total ordering here (IMO).

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk