https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113298

--- Comment #2 from H. Peter Anvin <hpa at zytor dot com> ---
You're not wrong per se. Arguably the problem (and many others) would be better
solved by allowing user-specified conversations that are not member functions.
In that case one could do:

// Set the properties/types for which
// we allow pointer conversations from
// void *
template <typename T>
concept void_pointer_convertible = ...

template <typename V>
concept some_void_type = std::is_void_v<V>;

template <void_pointer_convertible T, some_void_type V>
operator T * (V *ptr) { return static_cast<T *>(ptr); }

... and now the programmer has full control over exactly what they wish to
permit.

Reply via email to