
1 Mar
2009
1 Mar
'09
5:22 p.m.
On Sun, Mar 1, 2009 at 3:36 PM, Roland Bock
Ovanes,
I wonder, though, is there a standard way to write integers to a stream_buf? As far as I can see, the ostreambuf_iterator takes character classes as template arguments, only.
Regards,
Roland
Roland, please take a look at this code: http://codepad.org/UGubU7cw It it always customized numeric converter is almost always faster as writing integers to stringstream with operator<<. Anyway these two tests perform most equally on linux/g++ (but tested very roughly). For Example on MSVC-compiler std::copy was faster as the for-loop. I assume compiler can better optimze in this case. Good Luck, Ovanes