Previous section   Next section

Imperfect C++ Practical Solutions for Real-Life Programming
By Matthew Wilson
Table of Contents
Chapter 29.  Arithmetic Types


29.4. Copy Construction

This one's simple. The UInteger64 class is a simple value type that does not manage any resources (see Chapters 3 and 4), so you can leave it to the compiler to provide a copy constructor by default, or you can explicitly define one and perform a memberwise copy. There's no compelling reason to do the latter, beyond consistency with your own coding standards.



UInteger64 i   = 0;


UInteger64 i2  = i; // Assignment syntax


UInteger64 i3(i);   // Constructor syntax




      Previous section   Next section