Re: C++ question related to casting

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Tue, 23 May 2006 20:46:19 +0200

tis 2006-05-23 klockan 13:22 -0400 skrev Nick Lewycky:

> It's a temporary. pe->getReply()->head will get casted into the
> HttpHeader, used to call putStr(...), then its life is over, at which
> point the C++ implementation is free to destroy it at its leisure (some
> impl's do it after the end of the statement, some wait until the end of
> the function).
>
> Even if you'd said "HttpHeader HH = ...", it would still create a
> temporary, copy-construct the new HttpHeader, and then destroy the
> temporary.

So why did the original get smashed when the temporary was destructed? A
missing copy constructor?

REgards
Henrik

Received on Tue May 23 2006 - 12:47:15 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Jun 01 2006 - 12:00:04 MDT