Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Type Traits Extension by Frederic Bron
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-03-15 05:51:29


Frédéric Bron wrote:
>
>> * shift operator could be named bit_left/right_shift
>
> But this would let think that this operator operates only on integers
> which is wrong as it already operates with std::ostream std::istream
> from the standard library.
>

The std library overload the bitwise left/right shift operators for
output/input purposes. The semantic has nothing to be with a (bit) shift
operation. I don't see why removing the bit_ part will be clearer in this
case.

>> * has_operator_complement could be has_operator_bit_not
>
> Same comment although there is no class from the standard library that
> defines this operator, right? but user classes could.
>

For me &,|,^,~,<<,>> are bit operators and all should be named following the
same schema.

>> I'm thinking to operators ',', '()', '&' (address),
>> subscript . If I'm not wrong coma and address of could be implemented
>> without issues
>
> I decided to implement all traits that share a similar implementation.
> ',', '&' do not behave as other operators because there is always a
> default operator for them. Therefore the implementation must be
> different. I am not saying it cannot be implemented but it is
> something different. I found already challenging to maintain these 37
> operators with their specific behavior on fundamental types and
> pointers (in particular I wrote a long list of tests for all of them).
>

I have not yet see the implementation and the tests (I will do it this
evening), but in my opinion the logic of the 37 operators the library
defines already is limited to binary operators, prefix unary operators and
postfix unary operators. That mean that there are only 3 implementations to
maintain, and the use of macros should do the rest.

The same should apply for the tests. Write tests for the 3 kind of operators
and use macros to test all the operators.

I really would like to see the complete list of operators provided by the
library, at least be as good as operators traits of
Boost.ConceptsTraits/Operators is.
 
Best,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/Review-Boost-Type-Traits-Extension-by-Frederic-Bron-tp3353283p3356096.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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