Lecture Notes for Advanced Programming II

30 March 2004 - Template Functions


Outline


x-to-string Conversion


Avoiding Duplicated Code


Templates


Template Functions


Template Instantiation


Consistent Binding


A Successful Consistent Binding


Gotchas - Template Parameters


Gotchas - Strict Type Matching


Other Gotchas


Polymorphism


The string-to-x Problem


Explicit Template Parameter Bindings


Actual-Parameter Conversions


Formal Template Value Parameters


Bonus! - Vote Counting Revisited


Vote Counting With Template Functions


The Compile-Time Gotcha


Points to Remember


This page last modified on 1 April 2004.