468,504 Members | 1,985 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,504 developers. It's quick & easy.

std::format


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
Jul 14 '06 #1
1 6234
Gernot Frisch wrote:
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

Jul 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

103 posts views Thread by Steven T. Hatton | last post: by
15 posts views Thread by Marcus Kwok | last post: by
3 posts views Thread by Gary Wessle | last post: by
7 posts views Thread by Grey Alien | last post: by
5 posts views Thread by Donovan Parks | last post: by
9 posts views Thread by Fred Yu | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.