Re: Possible C++ optimizer problem
Re: Possible C++ optimizer problem
- Subject: Re: Possible C++ optimizer problem
- From: Steve Checkoway <email@hidden>
- Date: Wed, 19 Jul 2006 17:10:33 -0700
On Jul 19, 2006, at 4:41 PM, David Dunham wrote:
That would normally be my guess. But I changed this line
return Rack(*this).unload(used);
to this
string dummyTiles(m_tiles);
dummyTiles += "";
Rack dummyRack(dummyTiles);
return dummyRack.unload(used);
Without knowing what Rack, m_tiles, nor this are, it'd be hard to say
anything. Unless I'm mistaken, it looks like Rack's ctor takes a
string, string&, or const string& argument. Assuming that's the only
ctor with one argument, that would make this an instance of a
subclass of string. (I believe that subclassing the std classes is
not allowed. Certainly you cannot add new data members since they
might not be destroyed because string doesn't have a virtual dtor.)
If you compile with -Wall, do you get any warnings?
in order to delay the crash. So far as I could tell, all of that
was necessary -- I needed to use an explicit constructor rather
than the compiler-written copy-constructor, and I need to make sure
that the constructor's string arg wasn't the same. Otherwise, the
instance variable m_tiles was getting changed (the unload method
does alter m_tiles, though it doesn't trash it the way I was seeing).
How exactly was it being trashed?
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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