• 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: gcc and a problem with temporaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc and a problem with temporaries


  • Subject: Re: gcc and a problem with temporaries
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 30 Apr 2008 16:15:56 -0500

On Apr 30, 2008, at 4:12 PM, Steve Sisak wrote:

At 3:51 PM -0500 4/30/08, Scott Thompson wrote:
While adding that that makes sense for this toy example, it doesn't work in the original code where "Inited" is a "smart pointer" object. The "itemToCopy" is expected to relinquish control of the pointer it contains to the newly initialized object and is, therefore, not const in this context.

Just thinking off the top of my head, this may be a case for "conceptual constness" where it's OK to declare a method const then do a const_cast<> in the implementation to modify object state anyway.

Except don't use const_cast<>. Use the mutable keyboard for the state in question.


-Ken

_______________________________________________
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: 
 >gcc and a problem with temporaries (From: Scott Thompson <email@hidden>)
 >Re: gcc and a problem with temporaries (From: Steve Sisak <email@hidden>)

  • Prev by Date: Re: gcc and a problem with temporaries
  • Next by Date: Re: gcc and a problem with temporaries
  • Previous by thread: Re: gcc and a problem with temporaries
  • Next by thread: Re: gcc and a problem with temporaries
  • Index(es):
    • Date
    • Thread