|
Boost : |
From: Marco (mrcekets_at_[hidden])
Date: 2007-04-20 04:32:44
On Fri, 20 Apr 2007 04:26:04 +0200, Steven Watanabe
<steven_at_[hidden]> wrote:
> Um. Since you are looking for the exact
> signature (untested):
>
> namespace detail {
>
> namespace is_overloaded_adl_barrier {
>
> typedef chr no;
> struct yes { no dummy[2]; };
>
> struct no_overload {};
>
> yes is_overloaded_impl(...);
> no is_overloaded_impl(const no_overload&);
> struct any_conversion {
> template<class T>
> any_conversion(const T&);
> };
>
> no_overload atan2(any_conversion, any_conversion);
>
> template<class T>
> T make();
>
> template<class T>
> struct has_atan2 :
> mpl::bool_<
> sizeof(is_overloaded_impl(atan2(make<T>(), make<T>()))) ==
> sizeof(yes)
> >
> {};
>
> }
>
> using is_overloaded_adl_barrier::has_atan2;
>
> }
>
> In Christ,
> Steven Watanabe
Nice! :-)
I tested it and it seems to work but it's necessary to add "using
std::atan2" inside is_overloaded_adl_barrier namespace else only
"no_overload atan2(any_conversion, any_conversion)" is seen.
Marco
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk