Re: const StringPtr != ConstStringPtr
Re: const StringPtr != ConstStringPtr
- Subject: Re: const StringPtr != ConstStringPtr
- From: Steve Mills <email@hidden>
- Date: Tue, 10 Jan 2006 13:48:06 -0600
On Jan 10, 2006, at 13:23, David Fang wrote:
If you expand the typedefs, you'll see why they are not the same:
StringPtr is a pointer to char
ConstStringPtr is a pointer to const char,
the pointer itself is mutable, but the pointee (char) is
read-only.
const StringPtr is a const pointer to char,
that is, the pointer is const (immutable) while the pointee (char)
remains modifiable.
const ConstStringPtr is a const pointer to const char
Oh duh. Even with the thousands of times I've typed const in various
places in function declarations and everywhere else, I looked at the
typedef and totally interpreted it wrong. Thanks for the jump start.
So I guess this means that CW is wrong in letting this pass when the
"strings are read-only" setting is on.
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
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