[Bug c++/61174] Bad resolving of specialized template with const-qualified member function
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Tue May 13 15:03:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61174
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Instead of starting from scratch, why don't you use
std::is_member_function_pointer? It handles correctly all sorts of member
functions. Alternately, study the implementation and learn from it.
In any case, you have of course a problem with the constness of g, you would
have to add:
template<typename C, typename T> struct A<T (C::*)() const>
{
int ok;
};
because otherwise the first specialization - as you can easily learn from
<type_traits> - matches f and all sorts of member pointers, for that matter.
More information about the Gcc-bugs
mailing list