Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-05-16 10:02:01

----- Original Message -----
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, May 16, 2001 8:51 AM
Subject: RE: [boost] What about "" and ""?

> 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
> if the latter two are allowed, is there a reason for not providing also
> +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 :).

Maybe, though unless we're sure about this, I think the best solution for
now is to simply remove it.

> Hmm.., interesting, what about unary operator minus (negation)? Assuming
> that T's default constructor creates an equivalent to zero<T>() (it's not
> 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 :).

As you say, it doesn't work well as a member of subtractable. Consider
unsigned types and sets. So where are you proposing to put it?


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