Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-05-16 07:51:29

David Abrahams wrote:
> Before I look at I'd like to hear from Aleksey that his
> concerns have been addressed.

They were, except the 'identity_querible' name, with which I am still
uncomfortable. Actually, isn't the unary plus operator a part of
(one-argument) 'addable' concept? IMO, expressions like +a don't make much
sense if you can't also write a1 + a2 and a1 += a2, and, on the other hand,
if the latter two are allowed, is there a reason for not providing also the
+a form? As for me, right now I can't think of one.. so we might have a
chance to make the library more consistent and get rid of the questionable
name at the same time :).

Hmm.., interesting, what about unary operator minus (negation)? Assuming
that T's default constructor creates an equivalent to zero<T>() (it's not a
unreasonable assumption, is it?), the following also could make sense
(although probably not very effective anyway):

friend T operator-(const T& x) { return T() - x; },

and probably not as a member of 'subtractable'. Just a thought :).


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