Skip to content

Commit 8c3be3f

Browse files
committed
Get rif of the protection against faulty inheritance of actors
The disadvantage is that then the child can access and modify parent's private members, such as mActivity, and cause rather unpredictable behaviours. I don't think it's worth having a protection which in the end would cause a different kind of bugs.
1 parent 42a5bf3 commit 8c3be3f

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

  • Framework/include/QualityControl

Framework/include/QualityControl/Actor.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,7 @@ class Actor
123123
return actor_helpers::requiresService<ConcreteActor, S>();
124124
}
125125

126-
// a trick to prevent bugs like "class TaskRunner : public Actor<CheckRunner>"
127-
// by keeping the constructor private, thus allowing only CheckRunner to initialize Actor<CheckRunner>
128-
// see https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/
129-
friend ConcreteActor;
130-
131-
private:
126+
public:
132127
explicit Actor(const ServicesConfig& servicesConfig)
133128
: mServicesConfig{ servicesConfig },
134129
mActivity{ servicesConfig.activity }

0 commit comments

Comments
 (0)