Re: gcc and a problem with temporaries
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