Hello yesterday I read your excellent articles about strong types in C++ and your library which was exactly what I was looking for.
But while looking through the code I found some things I hope I can improve upon. Obviously all of these changes are discussable.
noexcept for the .get method
noexcept for the constructors if constructing T is noexcept
default constructor if T is default constructible (You could make a case for not allowing strong types to be default constructible)
PostIncrementable skill
Pre- and PostDecrementable skill
Mathematical assignment operators for multiplication, subtraction etc.
Divisible skill
Modulable skill
All the other bitwise operations
nodiscard attribute for .get()
Arithmetic skill which simply includes all the arithmetic operations
There were also some things which I wanted to discus first before making any changes:
Is there a reason for having a type be incrementable aka having the += operator but not addable? I would argue that addable implies incrementable but I didn't want to break the interface of exists code.
This line confuses me. The get method should return a const reference as the argument 'name' is passed as const. Which would prevent us from changing its value. At least that what I think, but I've only tested it on MSVC where it doesn't compile. But it also could be valid C++ and MSVC is just a bit buggy (wouldn't be the first time).
Thanks for your excellent work and kind regards
André
Wow, what an epic PR! I've finished integrating it into master. Thanks so much!
I'm very grateful for your work on the library, and sorry for taking so much time to get back to you.
Hello yesterday I read your excellent articles about strong types in C++ and your library which was exactly what I was looking for. But while looking through the code I found some things I hope I can improve upon. Obviously all of these changes are discussable.
There were also some things which I wanted to discus first before making any changes:
Thanks for your excellent work and kind regards André