Strategy pattern depends on inheritance and will rely on virtual functions. Accessing them comes with additional cost. Policy-Based Class Design pattern make use of templates to achieve what Strategy pattern does.
Architecture, C++, Python & Scala
Strategy pattern depends on inheritance and will rely on virtual functions. Accessing them comes with additional cost. Policy-Based Class Design pattern make use of templates to achieve what Strategy pattern does.