Right, I'm saying that's not necessary, you can just do this:
struct my_type;
struct my_type *my_type_new(void);
This is more common than `typedef void*` in my experience, because it actually provides some minimal amount of type safety.You can also do this in C++ of course, but you can't use member functions this way. My real complaint here is that the Pimpl idiom in C++ is more cumbersome than a simple forward declaration and free functions, which is available in C.
sorry what ? most C libraries I know hide their implementations behind opaque types such as `typedef void* my_handle_t`.