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-30 07:21:54


Joachim Faulhaber wrote:
> 2011/3/29 Frédéric Bron <frederic.bron_at_[hidden]>:
> >
> > I have updated this page for this (last column of the table):
> > https://svn.boost.org/trac/boost/wiki/Guidelines/Naming/Operators
> > This is my current proposal which is very close to Boost.Proto apart
> > for pre/_inc/dec->pre/post_increment/decrement and
> > negate->unary_minus (to keep symmetry with unary_plus).
>
> Standard and boost (proto, accumulator, phoenix, ..., boost::operator:
> "negatable") agree on "negate". Why celebrate diversity here?

I agree with Frédéric. Consistency with "unary_plus" is beneficial. It would be possible to include both, I suppose, but I'd prefer "unary_minus" to "negate." The name in the standard is not for a type trait, but a function object which, as you know, I don't find a compelling precedent. ISTR that Eric was willing to alter Proto to match any common naming to produce intra-Boost consistency, so Proto's use of "negate" may be of limited import.

> I don't think component "operator_" should be inserted. The prefix
> "can_call_operator_" accounts for over 60% of information of the
> proposed names. Name components shall only be added, if they carry
> indispensable information. Yet the fact, that we deal with operators
> here is completeley clear from the context of use.

+1

I'm not concerned with length for typing's sake so much. Instead, the name lengths must be considered in light of their effect on line lengths when used in expressions like "typename boost::enable_if<boost::can_call_bitwise_and_assign<T,U>,my_type>::type". The longer the name, the sooner line wrapping applies.

If the "operator" part is considered important, then I'd definitely prefer "op" over "operator" because of the latter's length and because it is a common abbreviation of "operator" and "operation," which both work in this context.

> Apart from that I think can_call_xxxx is o.k. and I can also live with
> is_callable_xxxx has_xxxx

That makes three of us, at least, in favor of the "can_call" prefix.

_____
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