Lecture 5 - Slide 37 : 40 |
We parameterize class Point with a 'policy for distance and comparison'
![]() | Class Point parameterized with a policy class. |
![]() | Program output. |
![]() | Four different policy classes - with type parameterized static methods. |
![]() | The Point class template definition - policy parameterized. |
![]() | Member functions in class Point. |
Below we parameterize individual functions with a policy
![]() | Program output. |
![]() | Four different policy classes - with type parameterized static methods. |
![]() | The Point class definition - not a template in this version. |
![]() | Member functions in class Point - not essential to this example. |