Do anyone know if there is a STL interface compatible string class that allocates memory for small strings on the stack (up to a certain threshold) and the heap for larger s
You can provide a custom allocator for std::basic_string (it is the third template argument). This answer explains how use that and links to an implementation of a stack-allocator that can be used.