Complete Example 11.2. In particular, write
a generic Complex
and Fraction
class,
and fix main()
so that it works and uses those classes.
Write a template version of swap()
, based on Example
5.13. Write client code to test it thoroughly.
Are there any types for which swap()
does not work?
Specify the restrictions on the class parameter in your template swap function.
[ fromfile: templates.xml id: None ]
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |