I need to map component IDs to components in a C++ game engine. Those component IDs should be strings. I cannot use std::string because I need extremely high performance performance as high as possible without hurting ease of development too much, and the conversion from const char*
to std::string
every time I look up an entry is way too costly.
According to this answer, using const char*
can lead to comparison issues. What is the right way to use C-style strings as map keys, without those comparison issues?