When developing projects I often run into a common problem,: I have an enum that I need strings for, either for display purposes or for testing and debugging. In the project I'm currently developing, I encountered this for 2 different enums. Initially I created 2 different classes to do the translation using 2 different implementations. I am now trying to refactor that code to reduce the amount of code in the project (currently 1530 lines of code). I initially used std::map in one of the implementations, but, in a previous review I was informed that there is a cost to using std::map.
I would ask if there were memory leaks, but valgrindValgrind assures me there are no memory leaks. Running valgrindValgrind did help find 2 errors in the code that have been corrected.
The code provided is a stand alonestandalone unit test.
- Using the C++ 20 standard, isare there any additional features that I can use to reduce the amount of code needed in either the
DictionaryBase class or any of it'sits sub-classes.
- Can performance or memory usage be optimized?
- Could you maintain the code?
- Are the naming conventions clear or should some of the class and method names be changed?
- What would be the highest maintenance cost if you needed to maintain this code?
- C++ 20
- CMake
- gccGCC 12
- Ubuntu 22.04
- Visual Studio Code (vscode)