![]() ![]() ![]() ![]() ![]() ![]() ![]() | Templates and The Standard Library - slide 9 : 46 |
I parameterize class Point with a 'policy for distance and comparison'
In the real world it seems more reasonable to parameterize functions - rather than classes - with policies
![]() | The Point class definition - a template - policy parameterized. |
![]() | Member functions in class Point. |
![]() | Four different policy classes - with type parameterized static methods. |
![]() | A sample application. |
Below we parameterize individual functions with a policy
![]() | Member functions in class Point - not essential to this example. |
![]() | Four different policy classes - with type parameterized static methods. |
![]() | A sample application - together with policy parameterized functions. |