|
|
|
|
|
by maccard
2724 days ago
|
|
I don't disagree that I haven't created any types, but to someone who doesn't see the declaration of meter or centimeter, it can be difficult to know that. Especially if you combine it with almost always auto. You can created tagged structs, but you inevitably end up needing to extract the value underneath. Regarding casts and void pointers, I think they're a slightly less dangerous case. My Spidey senses tingles whenever I need casts - static (or to a certain extent dynamic) casts are normally ok, but a reinterpret cast or a void* parameter is going to warrant a discussion and explanation in a code review. |
|
We definitely agree here. Better would be to use a library such as Boost Units, rather than naked aliases.
void* is definitely problematic, and I kill it every chance I get, but it persists in a lot of code due to C libs and unfortunate legacy dependencies.