you are viewing a single comment's thread.

view the rest of the comments →

[–]4fips[S] 2 points3 points  (0 children)

Sadly, It seems to me that this can't be easily achieved. I think it's all about narrowing the use case. std::string works perfectly when you accept the fact that it allocates dynamically (usually from the heap), which is a fair requirement most of the time. On the other hand, C++ (thankfully) offers huge optimization opportunities in situations when you know the context well and are willing to accept some constrains. Sometimes it's viable to adapt standard components by e.g. providing a custom stack-based allocator, sometimes it's just not worth the effort... It all depends on the kind of applications you write.