The member variable L
in your Graf_Neorientat
class can be assigned and copied just the same way as if it was a normal variable in your program. So you don't need to do write again that code in Graf_Neorientat
to be able to copy L
when Graf_Neorientat
is copied.
Now, probably what you wanted to ask instead is if you need to do something "extra" in Graf_Neorientat
to make it also copyable (and copy L
when doing so).
Assuming Graf
is copyable (or ignoring Graf
), the answer is no. If your List
class is copyable, then your Graf_Neorientat
will be copyable. The compiler will define implicitly the assignment operator and copy constructor for you, which will call in turn the List
ones to copy the L
member appropriately.
Of course, you can disable copyability yourself in Graf_Neorientat
if you want in several ways, and you can also define a different assignment operator and copy constructor if you wish to do something else (rare). But, as given in your example, Graf_Neorientat
will do what you expect.