In a function i'm passing ostream and wants to convert into a string.
void func (ostream& stream) {
/* Needs to convert stream into string */
}
void func (ostream& stream) {
/* Needs to convert stream into string */
std::stringstream ss;
ss << stream.rdbuf();
std::string myString = ss.str();
}