Sometimes you have a class that is designed to be inherited, but not all its functions are expected to be used all the time. Therefore, to make for more readable and easier to maintain derived classes, the inheritable functions are defined, but are empty (instead of being pure virtual). An example from RakNet
virtual void OnDirectSocketReceive(const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) {(void) data; (void) bitsUsed; (void) remoteSystemAddress;}
Now in most cases the function has some arguments and on Level 4 warnings, it gives the warning the function arguments were not used. I am currently following RakNet’s example above and doing nothing with the data. Is that the standard/common way of getting rid of the warning? Can this design be avoided altogether? Any general thoughts/insight/suggestions?
Another way is to not name the parameters. That shows that the function has no intention to use them: