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 18:48:33


Hi,
 
The following two types are not used anywhere
   typedef typename ::boost::remove_cv::type rhs_nocv;
   typedef typename ::boost::remove_cv< typename ::boost::remove_reference<
typename ::boost::remove_pointer::type >::type >::type rhs_noptr;
 
Shouldn't them be removed?
 
I have not see the utility of removing the reference
   typedef typename ::boost::remove_reference::type rhs_noref;
 
Could you explain me why this is needed?
 
I have a little problem with the has_operator_ prefix on the name of the
traits. The traits is not checking the class parameter(s) has/have an
operator, but that the application of the operator to this/these types is
syntactically correct. E.g. has_operator_plus&lt;int, double&gt;::value
neither int nor double have an operator+. applicable_operator_plus&lt;int,
double&gt;::value or can_apply_operator_plus could be an option.

If we wanted to define a trait to see if a class has a member function
begin(), i.e. c.begin() is correct, we could name it has_begin. But if we
wanted to check if we can call begin(c) how we name the trait, has_begin?

Note that in the standard all the traits prefixed by has_ applies to some
property the type has. I recognize that this is not to important, but if
someone could find a better name ... Forget this last comment if you find it
is misplaced.

Best,
Vicente

P.S. Typo: There is at least a BOOST_TT_TRAIT_OP in the documentation to be
replaced by -.
 
 

--
View this message in context: http://boost.2283326.n4.nabble.com/Review-Boost-Type-Traits-Extension-by-Frederic-Bron-tp3353283p3360904.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