Open TobiasWallner opened 3 years ago
Hi, i know that many years have past since this issue has been opened, but i've decided recently to make my own version of this library using your suggestions: https://github.com/Patrix9999/console-color
Maybe this will help someone.
You are using a lot of std::string types and always copy them. Consider using const char* pointer since you are only using raw literal strings. This will avoid unnecessary copys and allocations (this of course depends on the implementation of std::string and if its using short string optimisation)
And I took a deeper look at your code. Why are you not just using an enum value that already has the value needed for the win32 api? Something like
enum class hue {black = 0, .... }
Then you would just need to overload the stream operator for the enum.