• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: const StringPtr != ConstStringPtr
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: const StringPtr != ConstStringPtr (From: David Fang <email@hidden>)

  • Prev by Date: Re: Xcode 2.2 and Intel
  • Next by Date: Problem upgrading sample projects
  • Previous by thread: Re: const StringPtr != ConstStringPtr
  • Next by thread: Re: const StringPtr != ConstStringPtr
  • Index(es):
    • Date
    • Thread