The assignment operator from #15 does not work
Problem
The assignment operator for both classes does not define its parameter as const, which it needs to be. The operator right changes the object which is assigned, therefore it cannot be const.
Solution
The operator overload must be const. This means the parameter (the object that gets assigned) cannot be changed. This means there need to exists two copies of the object, which can be problem for the Wifi class, since it owns an instance of ModuleSPICommunication
The assignment operator from #15 does not work
Problem
The assignment operator for both classes does not define its parameter as
const, which it needs to be. The operator right changes the object which is assigned, therefore it cannot beconst.Solution
The operator overload must be
const. This means the parameter (the object that gets assigned) cannot be changed. This means there need to exists two copies of the object, which can be problem for the Wifi class, since it owns an instance ofModuleSPICommunication