You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: