I have a function func(int a, char b, void *ptr). The third parameter is reserved for internal use and it should be a nullptr for the current release. Is there a way to force this in the function prototype rather than the definition (checking and returning EINVAL)? By “better way” I mean some sort of new C++11 features that enable this.
I have a function func(int a, char b, void *ptr) . The third parameter
Share
You could change the type of the third parameter from
void*tonullptr_t(#include <cstddef>).