Boost logo

Boost :

Subject: Re: [boost] [Boost-users] [Review] Type Traits Extension by Frederic Bron - Review summary and decision
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-03-28 07:23:22


Joachim Faulhaber wrote:
> 2011/3/27 Frédéric Bron <frederic.bron_at_[hidden]>:
> >> - The main recurring suggestions found was the choice of
> >> name for the operator traits with respect to the
> >> standard naming, naming in proto and other boost
> >> libraries.
> >> * Frederic and a few other seems to favor the proto naming
> >> scheme (more or less the negate issue and the pre/post
> >> operator)
> >> * the question of a common prefix is still open
> >
> > What about is_callable_plus, is_callable_plus_assign, ...
> > i.e. is_callable_xxxx where xxxx the same as in Boost.Proto?
> >
> > I know that is_xxxx_callable reads better but I like to have
> > a common prefix longer than is_.
>
> Is there any problem related to using a short prefix like
> "is_"?

I like short prefixes when they are meaningful, but is_add/is_addition/is_plus means nothing. is_callable_add/is_callable_addition/is_callable_plus isn't much better (though using the "is_" prefix and "_callable" suffix works: is_addition_callable). "is_" seems to work well for some, like is_equal_to, until you realize that the implication is whether two types are equal, not whether the equality operator can be used with the two types.

"can_add" works for the addition case, but works awkwardly for equality: "can_equal_to."

"can_call_" seems to be a nice, reasonably short prefix: can_call_addition, can_call_equal_to, can_call_bitwise_xor, can_call_left_shift, etc.

_____
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