There's no need for this `if/else` branch. You can always return `out.str()`. It should be the empty string by default when you default construct a `std::stringstream`.