A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/022258.html below:

[Python-Dev] Re: PEP 285: Adding a bool type

[Python-Dev] Re: PEP 285: Adding a bool type [Python-Dev] Re: PEP 285: Adding a bool typeAndrew Koenig ark@research.att.com
03 Apr 2002 23:08:12 -0500
David> FWIW, that's the way it is in C++, and almost all of the same
David> conclusions fall out of it. Also, as distasteful as it may seem
David> intellectually, I have yet to hear any complaints about this
David> situation in practice... so it seems to work out OK.

It seems only fair that I should mention a complaint:  The fact that
bool is an integral type makes it necessary to have operator const void*
rather than operator bool as members of istream and ostream for
end-of-file testing.  Otherwise, writing ``cin << x'' instead of
``cin >> x'' by mistake would result in converting cin to bool
and thence to int, shifting the result right by x bits, and throwing
it away.

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4