Quote:Original post by herc
any obvious pitfalls visible by just inspecting the code?
I glanced over it, it looks ok.
One issue to keep in mind is that because its a stack-based array when you call erase on an element it isnt actually destructed. If you had it storing objects that were very sensitive to when they're destroyed this might cause unforseen complications, but that's not a problem with your code that's just what happens with the stack anyway.
Quote:thanks, this is great news! most of my small strings are never longer than 16 chars.
Good for you [smile]
This is why trying to second-guess the STL is usually a waste of time, its highly optimised in the first place. Just imagine if you'd spent all that time coding up a stack based string class when all you ever do is use it for 10-char strings [wink].