You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 System instances at runtime or to work with heterogeneous collections of Systems.
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.
The text was updated successfully, but these errors were encountered:
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
andNonlinearSystem
(both of which areSystem
s):System
instances at runtime or to work with heterogeneous collections ofSystem
s.The text was updated successfully, but these errors were encountered: