3 ms·
Wouldn't -Wextra yell about the Badge being an unused parameter in the register devices? You would have to do some kind of dummy call that the compiler would ha
by Something1234 7y ago
Wouldn't -Wextra yell about the Badge being an unused parameter in the register devices? You would have to do some kind of dummy call that the compiler would have to optimize away.
- jandrewrogers 7y agoThere are attributes for that, standardized as of C++17 and available in most compilers much earlier. -Wextra won't yell about anything.
- akling 7y agoIf an argument is nameless, the compiler won't complain about it being unused. No warning: void VFS::register_device(Badge<Device>, Device& device) { ... } Warning: void VFS::register_device(Badge<Device> badge, Device& device) { ... }