24 Apr
2013
24 Apr
'13
2:56 p.m.
2013/4/23 Robert Jones
On 25 March 2013 20:48, Jeffrey Lee Hellrung, Jr. < jeffrey.hellrung@gmail.com> wrote:
That's because the type of DefaultVal is void ( int ). Function types cannot encode the default'ness of parameters.
How about this example? This fails to compile for me, with a template instantiation ambiguity. Any thoughts?
Thx, Rob.
#include "boost/type_traits/has_call.hpp" #include <cassert>
template
bool HasCall(F const&) { return boost::has_call ::value; } void DefaultVal(int) {}
int main() { assert(HasCallboost::dont_care(int)(DefaultVal)); }
Sorry, it was a bug in C++11 mode. It's fixed on my github now, please check. https://github.com/jamboree/boost.has_call Seems that I missed the testcase for 'dont_care', will add later...