An std::string object itself isn't created on the heap unless you call new to allocate the std::string object itself. It's another matter that std::string manages pointers to memory allocated on the heap, but the std::string object itself will be placed on the stack if you just declare it normally.