Re: Type of @true in Obj-C vs Obj-C++
Re: Type of @true in Obj-C vs Obj-C++
- Subject: Re: Type of @true in Obj-C vs Obj-C++
- From: Jens Alfke <email@hidden>
- Date: Tue, 09 Jul 2013 11:56:40 -0700
On Jul 9, 2013, at 11:31 AM, Scott Ribe < email@hidden> wrote: I don't see what @true/@false have to do with true/false.
@true is a shortcut for @(true), so the compiler first evaluates ‘true’ and then boxes the result.
I think the issue is that the auto-boxing code has a special case for the Obj-C YES/NO constants that outputs boolean-type NSNumbers instead of 0/1, but it doesn’t have the same special case for the C99 ‘bool’ type.
On Jul 9, 2013, at 02:48 , Jean-Daniel Dupas < email@hidden> wrote: No, unless you redefine the true and false macros. The C standard specifies that true and false are macro that expand to integer constant with value 1 and 0 respectively.
In C99 ‘true’ and ‘false’ are builtin constants of type ‘bool’, not macros. (Right? IANALL.)
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden