[Bug libstdc++/91371] std::bind and bind_front don't work with function with call convention
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 16 09:45:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91371
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> template<typename T, bool = __is_class(T) || __is_union(T), typename = void>
This needs to exclude pointers as well as class types, because ...
> struct is_referenceable_function : false_type { };
>
> template<typename T>
> struct is_referenceable_function<T, false,
> __void_t<decltype(static_cast<T*>(std::declval<T&>()))>>
This static cast does an explicit conversion, which is allowed from X*& to X**.
The other alternative would be to test for implicit conversion, not explicit.
More information about the Gcc-bugs
mailing list