happly icon indicating copy to clipboard operation
happly copied to clipboard

Code cleanup

Open simogasp opened this issue 4 months ago • 0 comments

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 default for empty constructors/destructors
  • use make_unique() instead of allocating explicitly with new
  • define an implicit namespace detail instead of an anonymous namespace
  • use empty() instead of checking size() == 0 for 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.

simogasp avatar Oct 09 '25 12:10 simogasp