© { JSL }
91
Copy Constructor?
·
you can declare a "copy constructor"
w
it is
not
called for value parameters/returns
w
a copy is
always
a plain bitwise copy
struct
Pair
{
...
Pair(Pair other)
{
...
}
...
}
struct
Pair
{
...
Pair Func() ...
...
void
Func(Pair copy)
{
Pair p =
new
Pair(copy);
}
}
calling this does
not result in
infinite recursion
these do not call
the copy c'tor
only
this does