Boost logo

Boost :

Subject: Re: [boost] [type_erasure] default implementation of concept signatures
From: Jeremy Maitin-Shepard (jeremy_at_[hidden])
Date: 2011-05-28 16:43:46

On 05/28/2011 01:16 PM, Steven Watanabe wrote:
> On 05/28/2011 12:42 PM, Pyry Jahkola wrote:
>> On 2011-05-28 21:59:57 +0300, Matt Calabrese said:
>>> On Sat, May 28, 2011 at 2:55 PM, Steven Watanabe
>>> <watanabesj_at_[hidden]>wrote:
>>>> I don't have the concepts proposal handy, but
>>>> doesn't LessThanComparable have an axiom that
>>>> requires that (a< b) is equivalent to (b> a)?
>>> Yes.
>>> axiom Consistency(T a, T b) {
>>> (a> b) == (b< a);
>>> (a<= b) == !(b< a);
>>> (a>= b) == !(a< b);
>>> }
>> For what it's worth, e.g. NaN's are an exception to that rule...
> It's not an exception. The axiom only applies to
> LessThanComparable types. Technically, double
> isn't LessThanComparable, because it violates this
> rule.

Given that double is a commonly used type (and the fact that it has an
order is also often important), this does suggest that we may not want
to always guarantee that these consistency conditions hold, or may want
to allow certain values such as NaN to not satisfy the consistency
conditions while still allowing using the of type.

Boost list run by bdawes at, gregod at, cpdaniel at, john at