On 27/06/13 10:33, Walter Bright wrote:
On 6/26/2013 4:48 PM, Timon Gehr wrote:
On 06/27/2013 01:01 AM, Walter Bright wrote:
On 6/26/2013 3:56 PM, Walter Bright wrote:
On 6/26/2013 2:47 PM, Paulo Pinto wrote:
I have been an adept of iostreams since day one and never understood
why people
complain so much about them or the operator<< and operator>>
for that matter.

Even if you can get past the execrable look of it, it suffers from at
least 3
terrible technical problems:

1. not thread safe

2. not exception safe

3. having to acquire/release mutexes for every << operation rather
than once for
the whole expression


If it's not thread safe, why does it have to acquire mutexes?

It's not thread safe because global state can be set and reset for every
<< operation:

   a << b << setglobalstate << c << resetglobalstate << d;


Oh, and the cake topper is IOStreams performs badly, too.

Yes, but that's just a default.

std::ios_base::sync_with_stdio(false);
std::cin.tie(0);

Yeah, to make it as fast as C stdio you use C stdio. That's a ringing
endorsement!

This form of output usually causes problems with i18n as not all languages have the same types of grammar and sometimes the order of items needs to be changed to achieve a valid grammatical form in the translation.

Peter

Reply via email to