News for hackers. Stuff that matters.
Re:C++ Patterns: The Badge by Something1234 on Tuesday June 11, 2019 @10:01PM (#20161127)
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.
Re:C++ Patterns: The Badge by akling on Tuesday June 11, 2019 @11:27PM (#20161529)
If 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) { ... }
Re:C++ Patterns: The Badge by jandrewrogers on Tuesday June 11, 2019 @10:37PM (#20161274)
There are attributes for that, standardized as of C++17 and available in most compilers much earlier. -Wextra won't yell about anything.