Skip to content

PowerSaver & Wifi class cannot be assigned #23

@stoffera

Description

@stoffera

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions