|
Boost Users : |
Subject: Re: [Boost-users] [FunctionTypes] Testing for a general callable type.
From: TONGARI (tongari95_at_[hidden])
Date: 2013-04-24 10:56:12
2013/4/23 Robert Jones <robertgbjones_at_[hidden]>
> On 25 March 2013 20:48, Jeffrey Lee Hellrung, Jr. <
> jeffrey.hellrung_at_[hidden]> 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));
> }
>
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...
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net