I have a task where I need to do the following.
I have 3 classes with A links to many B association
A->*B->*C
A: Contains only -iA_ : int
B: Contains only -iB_ : int
C: Contains only -IC_ : int
The task is:
Implement the necessary codefor all classes so that A
contains a copy structure for deep copies. Container type list. Setter and getter are not necessary!
Further constructors and destructors are not necessary!
If you use default implementations you have to justify this.
So I have implemented it is this correct?
class C
{
private:
int iC_;
}
class B
{
private:
int iB_;
std::list<C*> CList_;
public:
B(std::list<C*> CList) : CList_(CList)
{
}
}
class A
{
private:
int iA_;
std::list<B*> BList_;
public:
A(std::list<B*> BList) : BList_(BList)
{
}
A(const A& crA)
{
iA_ = crA.iA_;
}
}