https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69924

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to derrick from comment #3)
>           if(static_cast<bool>(std::cin  >> loc)!=1)
>              return 1;
>           if(static_cast<bool>(std::cout << loc)!=1);
>              return 1;

This is not an improvement, because that code still relies on an implicit
conversion from std::cin/std::cout to another type. In additiona the second
"if" has a suspecious semicolon right after the parentheses.

This should be correct code:

          if((static_cast<bool>(std::cin)  >> loc)!=1)
             return 1;
          if((static_cast<bool>(std::cout) << loc)!=1)
             return 1;

and it is accepted by the compiler as it should be.

Reply via email to