Skip to content

Commit d440fb0

Browse files
committed
extract compile-time checks to a dedicated method for readability
1 parent 73f19bc commit d440fb0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • Framework/include/QualityControl

Framework/include/QualityControl/Actor.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@ class Actor
8989
mServicesConfig{servicesConfig},
9090
mActivity(servicesConfig.activity)
9191
{
92-
// todo extract to a separate method
93-
// todo also do it for onProcess and onInit
94-
// compile-time checks which can be performed only once ConcreteActor is a complete type, i.e. inside a function body
92+
// compile-time (!) checks which can be performed only once ConcreteActor is a complete type, i.e. inside a function body
93+
assertCorrectConcreteActor();
9594

95+
}
96+
97+
consteval void assertCorrectConcreteActor() const
98+
{
9699
// mandatory methods
97100
static_assert( requires(ConcreteActor& actor, framework::ProcessingContext& pCtx) { { actor.onProcess(pCtx) } -> std::convertible_to<void>; });
98101
static_assert( requires(ConcreteActor& actor, framework::InitContext& iCtx) { { actor.onInit(iCtx) } -> std::convertible_to<void>; });

0 commit comments

Comments
 (0)