Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Extension ending tomorrow
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-03-18 12:51:19


John Maddock wrote:
>
> >(1) has_operator_xxx seems to be imprecise and misleading.
>
> How so? Personally I like the idea of a common prefix for
> all of these.

The intention is that "has_operator_xxx" be read as "expressions involving these two types can use operator xxx." The types needn't "have" such an operator where "have" suggests membership, that the operator is a member of a type.

A common prefix doesn't have to be common for all type traits. There are already "add_," "has_," "is_," "make_," and "remove_" common prefixes. Note also that those beginning with "has_" refer to properties of types. These new traits do not.

> >(2) has_operator_xxx introduces a redundant prefix
> > 'has_operator' that IMO is unnecessary
>
> Maybe, but it makes it explicit what you're testing, and puts
> all the operator traits together in the alphabetical index -
> a small point I know, but it is useful none the less!

That's actually a good argument against using "has_" because you *don't* want these new traits grouped with the existing "has_" traits.

> >(3) If there are close relationships between Concepts and operator
> >traits their names should express this relation as well.
> >
> >My current proposal is:
> >
> >plus_assign_callable or even better
> >plus_assingable instead of has_operator_plus_assign
>
> I'd prefer is_plus_assignable if we go that route.

is_add_assignable

(The operation is addition followed by assignment, not plus followed by assignment.)

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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