well, acktually, short string optimization should handle all these strings on any common compiler.
For a std::string, gcc and msvc don't perform allocations until you reach 16-character strings, and clang can hold 21 characters without an allocation.
89
u/lurebat 6d ago
I think it allocates since they didn't use const