| <<< | Index | >>> |
Consider:
#include "point.h"
void draw_segment( Point from, Point to ) { /* Connect two points */ }
void main()
{
Point pt1( 5, 15 );
Point pt2( 10, 20 );
draw_segment( pt1, pt2 );
}
What should happen when objects are passed as parameters?
Again, we want to be able to control semantics.
If you don't provide a copy constructor, one will be provided for you,
free of charge...
...you guessed it.
| <<< | Index | >>> |