-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Labels
enhancementNew feature or requestNew feature or request
Description
A Curiously Recurring Template Pattern (CRTP) would probably be a better design choice instead of classic inheritance that makes use of virtual functions.
Advantage in the case of, e.g. LinearSystem and NonlinearSystem (both of which are Systems):
- There's need to replace
Systeminstances at runtime or to work with heterogeneous collections ofSystems. - CRTP would be more flexible
- Virtual methods imply vtable lookups at runtime. With CRTP the compiler knows which class gets instantiated, thus guaranteeing better performance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request