Re: Why are BOOL and bool distinct types?
Re: Why are BOOL and bool distinct types?
- Subject: Re: Why are BOOL and bool distinct types?
- From: "Sean McBride" <email@hidden>
- Date: Wed, 8 Jun 2005 10:08:44 -0400
- Organization: Rogue Research
On 2005-06-08 01:44, Todd Blanchard said:
>Digging around the header of NSMethodInvocation I see a
>NSObjCBoolType 'B' tag has been added. Nifty, so why is @encode
>(BOOL) == c but @encode(bool) == 'B'?
It's historical. When Obj-C was invented C did not have a 'bool' so
they typedef'ed one as BOOL = char.
But since C99, C does have a bool type (<http://www.comeaucomputing.com/
techtalk/c99/#bool>) but Apple keeps their old one around for
compatibility I guess.
Maybe BOOL should be deprecated now that C99 has a native type?
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden