← Questions
Optimize a small-string class in C++
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build a high-performance C++ string class for a workload with very many strings, supporting operations such as compare, concatenate and substring. Short strings live in a fixed-size buffer inside the object and longer ones on the heap (small-string optimization). Start with the constructor, then the copy and move operations and the destructor, and explain how each operation avoids allocations.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
