
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