Re: bool or BOOL in MFC projects
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Wed, 19 Dec 2007 11:10:34 -0600
On Wed, 19 Dec 2007 11:02:55 -0500, David Wilkinson <no-reply@xxxxxxxxxxxx>
wrote:
Joseph M. Newcomer wrote:
But if(p) is a type violation.
Conversion of pointer to bool is an accepted feature of the C++
language. It is used, for example in the idiom
int i;
while (cin >> i)
{
// do something to i
}
(std::ios has conversion to void*, not to bool).
Ironically, the conversion to bool has more undesirable side effects than
the conversion to void*, mainly because bools can be used in arithmetic
expressions.
--
Doug Harrison
Visual C++ MVP
.
- References:
- bool or BOOL in MFC projects
- From: Vaclav
- Re: bool or BOOL in MFC projects
- From: Stuart Redmann
- Re: bool or BOOL in MFC projects
- From: David Ching
- Re: bool or BOOL in MFC projects
- From: Ian Semmel
- Re: bool or BOOL in MFC projects
- From: Brian Muth
- Re: bool or BOOL in MFC projects
- From: David Lowndes
- Re: bool or BOOL in MFC projects
- From: David Webber
- Re: bool or BOOL in MFC projects
- From: Joseph M . Newcomer
- Re: bool or BOOL in MFC projects
- From: David Wilkinson
- bool or BOOL in MFC projects
- Prev by Date: Re: Resources in a static library
- Next by Date: Re: Installing on Vista
- Previous by thread: Re: bool or BOOL in MFC projects
- Next by thread: Re: bool or BOOL in MFC projects
- Index(es):
Relevant Pages
|