On Sun, Apr 29, 2012 at 10:11:42PM -0500, Dick Hollenbeck wrote:
> Since the compiler is pretty clever in a situation like this, it has the 
> choice of using
> the copy constructor, and I am sure gcc has something like this also:
> 
> 
>     http://msdn.microsoft.com/en-us/library/ms364057%28VS.80%29.aspx
> 
> 
> Remember, there is intentionally no virtual function table pointer in this 
> class, (I
> deliberately avoided a virtual destructor so as to avoid a virtual function 
> table
> pointer), and its only two doubles.  Not hard to construct it.

Actually g++ does it (and it also had an extension to suggest the variable used 
to return the value). The condition IIRC is that there should be no copy 
constructor (otherwise it must be called to obey copy semantic). But as you 
don't like nonconst references I don't like passing by value of nonatomic 
structures:P

Anyway is an internal utility so who cares, only these four classes use it...

-- 
Lorenzo Marcantonio
Logos Srl

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to