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 "dlw_oprs.zip" and "dlw_util.zip"?

> David Abrahams wrote:
> > Before I look at dlw_oprs.zip 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 :).

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
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 :).

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?

-Dave


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