happly
happly copied to clipboard
Code cleanup
Hi, this PR cleans up a little bit the code with minor changes:
- constness for variables, function arguments, and methods
- avoid c-style casting but rather use static or reinterpret cast
- use range loops where possible
- remove
virtualfrom overridden methods as it is not necessary - use
defaultfor empty constructors/destructors - use
make_unique()instead of allocating explicitly withnew - define an
implicit namespace detailinstead of an anonymous namespace - use
empty()instead of checkingsize() == 0for containers
I also had to raise the minimum CMake version because on recent versions the minimum that was required is not supported anymore.
I have some other code improvements requiring C++20 standard (concepts, ranges algo etc), if you are interested I can make another PR after this. Also the CMakeLists for testing can be simplified quite a bit using fetch_content to retrieve the GTest automatically. I can make a PR about that too.