cpp_weekly
cpp_weekly copied to clipboard
strongly typed wrappers
Would want to make the tool as automagic as possible, with concepts automatically enabling requested features.
There are a few of those wrappers available on GitHub. The first I saw was NamedType, from Jonathan Boccara (Fluent C++). I remember thinking it's neat, but also that I would have a hard time convincing coworkers of using heavy machinery involving CRTP to replace a simple built-in.
If I may self-promote: I wrote a guest post about how just wrapping a built-in in a struct, with nothing else, is already an improvement, and it's easier to convince people of using that method in my work experience. Maybe you could suggest that as a first step towards using strong types.
Edit: another thing I've come across is using an enum class with specified underlying type. This is what has been done for std::byte. Works only for integral types though.