Skip to main content
gamedev.net
🔒 Locked

std::string and std::stringstream: reserve buffer space

Started by Max_Payne 0 replies 6.3k views
Original Post
Max_Payne
Max_Payne
Is it possible to reserve space in the internal buffer of an std::stringstream, in order to avoid too frequent reallocations? What about an std::string?

Looking for a serious game project?
www.xgameproject.com

Looking for a serious game project?
www.xgameproject.com
antareus
antareus
std::string s;
s.reserve(1024);

Not sure about stringstream.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.