c++ - Converting a stream to bool doesn't work on another compiler -


Why does this work but fails with it? It also works on GCC:

  bool b = std :: cin;    

You should add the language standard and the compiler that you compile.

By C ++11, std :: basic_ios had operator zero * , because instead of explicit operator in C + 11 Boole is

The second one is obvious, which means that an underlying conversion like your example can not use it.

  operator zero * () const {return this  

-> (unsuccessful)? 0: const_cast & lt; Basic_ios * & gt; (this); }

The bug has been resolved from 2014-09-24, so the next release should be corrected.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -