That was exactly my use case. I had a class with about 5 strings and needed like 8 of them in an array/vector and that was stupidly memory heavy to store just empty strings to start with.24 bytes is significant, imo. It could add up in struct's etc? Why not a separate string class, for short word strings? or a template where the user could set it?
Strange how they made this the default?
(That's why I don't like C++ nor the standard template library, it's all too complex for no reason or benefit.)
I also feel there must have been a better way to evolve the standards for better string representation options. I really liked the way Symbian strings/descriptors worked for instance.
Thanks for sharing that video.
I'm not sure what was the right thing to do but I also feel like making the assumption that all systems running C++ can afford that sort of memory overhead for strings is a bit drastic.Memory representation have been hell in C++ for some time. The right thing to do was to optimize the string implementation in a new object rather than publish into the spec.
Statistics: Posted by Slion — Wed Feb 12, 2025 11:26 am