Boost logo

Boost Users :

Subject: Re: [Boost-users] Using SFINAE to detect presence of member function - Unreliable
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2009-02-03 05:02:49


2009/2/2 Naik, Roshan <roshan.naik_at_[hidden]>

> Seems like the following specialization of impl<> works:
>
>
>
>
>
> template <typename r>
>
> struct impl<true, r(void)>
>
> {
>
> static const bool value =
>
> sizeof(
>
> return_value_check<type, r>::deduce( (
>
> (((derived_type*)0)->operator()(),
> details::void_exp_result<type>())
>
> ) )
>
> ) == sizeof(yes);
>
>
>
> };
>

I don't think it does. Try this test:

struct foo {
   void operator()() const {}
};

int main() {
  is_call_possible<foo, void()>::value;
}

Roman Perepelitsa.



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