Re: I am confused with these concepts.
- From: "Brian Muth" <bmuth@xxxxxxxx>
- Date: Mon, 28 Jan 2008 11:31:11 -0800
"rockdale" <rockdale.green@xxxxxxxxx> wrote in message news:dd0ac1c1-right?
in this case (returning class), the myClass is automatic variable and
is destroyed when it goes
out of scope this function, right? But because we return myClass, so
the content of myClass is COPIED to the caller?
Still, in this case, I still did not see the necessary to use
pointer.
----------------------------------------
Your concept is correct.
It's up to you to decide whether to use a pointer or not. Obviously, copying a pointer value is very cheap. Depending on the class, copying a class instance might be very expensive.
Brian
.
- References:
- I am confused with these concepts.
- From: rockdale
- Re: I am confused with these concepts.
- From: Igor Tandetnik
- Re: I am confused with these concepts.
- From: rockdale
- Re: I am confused with these concepts.
- From: rockdale
- Re: I am confused with these concepts.
- From: Igor Tandetnik
- Re: I am confused with these concepts.
- From: rockdale
- Re: I am confused with these concepts.
- From: Igor Tandetnik
- Re: I am confused with these concepts.
- From: rockdale
- I am confused with these concepts.
- Prev by Date: Re: Newby question: vector<char*>
- Next by Date: Re: Class Destroys itself straight away!
- Previous by thread: Re: I am confused with these concepts.
- Next by thread: Re: I am confused with these concepts.
- Index(es):
Relevant Pages
|