This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Conversion to bool.
- From: Jan Ringoš <tringi at mx-3 dot cz>
- To: <gcc at gnu dot org>
- Date: Mon, 24 May 2004 00:10:01 +0200
- Subject: Conversion to bool.
- Organization: n.v.t. MX-3
Hello.
I come to this thing. I know that bools are actually stored as bytes (except stl where they are packed) but logicaly
they are single bits. Shouldn't then assignment of whatever nonnull to bool be always 1?
And also shouldn't
bool b = *(bool*)&number;
copy only the lowest bit of number?
Just an idea...
---
Jan Ringoš, Tringi@Mx-3.cz
http://Tringi.Mx-3.cz
n.v.t. MX-3, www.mx-3.cz