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<typename Sig, typename F>
bool HasCall(F const&)
{ return boost::has_call<F, Sig>::value; }

void DefaultVal(int) {}

int main()
{
    assert(HasCall<boost::dont_care(int)>(DefaultVal));
}

--
ACCU - Professionalism in programming - http://www.accu.org