[LC++]Question about ctors and dtors
Vincent.Penquerch at artworks.co.uk
Tue Apr 2 21:53:05 UTC 2002
> See the following code. When run, the output is only for the test()
> member. There is no output for the ctor and dtor. Why? Surely
> an object
> of the bogus class is being created?
You didn't insert anything in there.
mv returns a reference to an object (in this case, something
referencing memory after the array, which was not constructed).
It's not assigned, but used as a temporary, so the result won't
be copied (therefore no copy ctor).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the tuxCPProgramming