Equivalent of %02d with std::stringstream?
- by Andreas Brinck
I wan't to output an integer to a std::stringstream with the equivalent format of printf's %02d. Is there an easier way to achieve this than:
std::stringstream stream;
stream.setfill('0');
stream.setw(2);
stream << value;
Is it possible to stream some sort of format flags to the stringstream, something like (pseudocode):
stream <<…