Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Extension by Frederic Bron - Review summary and decision
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-04-29 04:24:29


2011/4/28 Christian Holmquist <c.holmquist_at_[hidden]>:
> On 28 April 2011 07:14, Max Sobolev <macsmr_at_[hidden]> wrote:
>
>> On 28.04.2011 15:57, Joachim Faulhaber wrote:
>>
>>> Here is my proposal for the operator trait names.
>>>
>>> Consistent with my preference on cross library and c++ standard naming
>>> consistency these are the collections of names that are (measurably)
>>> most consistent with the names used for operators in the standard
>>> (header<functional>), Boost.Proto and other Boost libraries. [...]
>>>
>>
>>  To save you some time, I have inserted my proposal as *column D* into the
>>> Wiki at
>>> https://svn.boost.org/trac/boost/wiki/GuideLines/Naming/OperatorTraitNames
>>>
>>
>> +1
>>
>> nearly optimal for me
>>
>>
>>
> +0.5. As a frequent user of Boost.TypeTraits, the names suggested by Joachim
> Faulhaber would be the ones I would look for.
>
> * I would prefer to see the word 'bitwise' instead of 'bit' however.

I agree. "bitwise" would be nicer and the naming consistency with
proto would be higher. Yet my #1 priority is naming consistency across
libraries. In other words I am aiming for standardisation. Accordingly
I have rules:

https://svn.boost.org/trac/boost/wiki/Guidelines/Naming/Operators

And of course, if there *is* a true standards, if I like it or not,
this existing standard hat priority #1 for the name choice.

Names bit_and, bit_or, bit_xor related to bitweise operators are not
in the current standard, but in the new standard, that is almost
completed, AFAIK. So we have three options here:

(1) Trying to change the new stadard in this specific point before its too late.
(2) Accepting names bit_xxx as the standard names for bitwise operators.
(3) Abandone the consistency goal.

The numbers indicate my prefereces here.

> * To be consistent with at least proto, has_left_shift should be
> has_shift_left (in all permutations of left/right + assign)

There is no naming from the standard for shift operators. Boost.Proto
and Boost.Operator disagree. I chose

left_shift
right_shift

because they can be "conceptified" by appending suffix "able". (Rule 4.b from
https://svn.boost.org/trac/boost/wiki/Guidelines/Naming/Operators)

left_shiftable
right_shiftable

which are the names used by Boost.Operators

Regards,
Joachim

-- 
Interval Container Library [Boost.Icl]
http://www.joachim-faulhaber.de

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