
9 Dec
2009
9 Dec
'09
7:18 a.m.
It is (almost) possible to check the exact return type.
template<class Expected, class Actual> boost::is_same<Expected, Actual> test(const Actual&);
Does not work with void return operator:
Of course it doesn't work as is. It would have to be added as an additional check after you already know that the return type is non-void.
But what do we really want? (i) check for convertible to something (default bool) or (ii) check for exact return type? For sure we need (i). Do we need (ii) and if yes, it would have to be another traits? Frédéric