std::format

G

Gernot Frisch

hi,

is it possible - or better: why hasn't it been in the std - to add
this function:

ofstream os("xy");
int my_int = 0;
double my_double =123.12;
os << std::format("8.3f", my_double) << std::format(".5d", my_int);

know what I mean? Because when you try to write a double in format
"%8.3f" to an ostream it's ridiculous what you have to write (using
ostringstream and such).

Where can I apply for that to be added?

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
 
M

Michiel.Salters

Gernot said:
hi,

is it possible - or better: why hasn't it been in the std - to add
this function:

ofstream os("xy");
int my_int = 0;
double my_double =123.12;
os << std::format("8.3f", my_double) << std::format(".5d", my_int);

Have a look at boost::format,
http://www.boost.org/libs/format/doc/format.html
Where can I apply for that to be added?

WG21 of course, see the comp.std.c++ FAQ for details. The logical place
to add it would be C++ Library Extensions TR2, which has an open call
for
proposals.

HTH,]
Michiel Salters
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top