Skip to main content
gamedev.net
🔒 Locked

Map<string, stringstream> not returning expected

Started by Aface Oct 17, 2003 at 11:34 PM 2 replies 1.1k views
Original Post
Aface
Aface
Hi All, I have code as below
std::map<std::string, std::stringstream> tempTest;

tempTest["Test"] << "String To Stream";

std::string retStr = tempTest["Test"].str();
It compiles fine, but when run, retStr has the value "". Is there something obvious im missing here? Thanks Aface [edited by - Magmai Kai Holmlor on October 17, 2003 12:43:15 AM]
Shannon Barber
Shannon Barber
Streams are not copyable.

[edited by - Magmai Kai Holmlor on October 17, 2003 12:48:30 AM]

[edited by - Magmai Kai Holmlor on October 17, 2003 12:48:35 AM]

What's with the perma-smile?

[edited by - Magmai Kai Holmlor on October 17, 2003 12:48:52 AM]
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Aface
Aface
Magmai,

Thanks for the quick response.

Could you explain a little more about streams not being copyable? Where am i making the copy (i assume its a temporary object?)

And whats a perma-smile?

Cheers
Aface

Topic Locked

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

Sign in to reply to this topic.