Re: Function Returning a local object???
From: John Harrison (john_andronicus_at_hotmail.com)
Date: 09/07/04
- Next message: Tieum: "Re: spawn under windows"
- Previous message: Tabrez Iqbal: "Re: Is C++ fundamentally broken?:was:Re: C++ unit testing"
- In reply to: velthuijsen: "Re: Function Returning a local object???"
- Next in thread: velthuijsen: "Re: Function Returning a local object???"
- Reply: velthuijsen: "Re: Function Returning a local object???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 7 Sep 2004 14:11:21 +0100
>
> Yes if you do not define the operator= the compiler will provide one
> for you. What is does is byte copying. The compiler will also create
> the constructor, destructor and copy constructor if you don't defined
> them.
>
Not true, it does member copying.
class X
{
std::string y;
int z;
};
X::operator= will copy the member y using std::string::operator= (this is
not a byte copy), and will also copy the member z (this is a byte copy).
Same principle for copy constructor.
john
- Next message: Tieum: "Re: spawn under windows"
- Previous message: Tabrez Iqbal: "Re: Is C++ fundamentally broken?:was:Re: C++ unit testing"
- In reply to: velthuijsen: "Re: Function Returning a local object???"
- Next in thread: velthuijsen: "Re: Function Returning a local object???"
- Reply: velthuijsen: "Re: Function Returning a local object???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|