Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Type Traits Extension by Frederic Bron
From: Jeffrey Lee Hellrung, Jr. (jhellrung_at_[hidden])
Date: 2011-03-15 09:11:40


On 3/14/2011 6:27 AM, Тимофей Игнатьич wrote:
> The default void return type should probably be changed to some internal dummy type.
> This would allow to check if the return type is actually void if so desired.
>
> class dymmy_type;
>
> template< class LHS, class RHS=LHS, class RET=dymmy_type>
> has_operator_op;

I actually prefer a "void" return type specified in the trait to mean
that you're ignoring the return type of the operator. This is (more)
consistent with the semantics of that template parameter when non-void.

Checking that the return type is *precisely* void, to me, falls into the
general category of checking that the return type satisfies some
user-provided MPL metafunction. What about if you want to check if the
return type is an rvalue or lvalue? Or a Proto expression? This is why
I've been advocating for an extra template parameter to enable this
capability for some time now.

- Jeff


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