// ExampleApp.cpp // In class example of generating versions of exchange() #include "SortSearch.h" int main() { int i=10, j=20; exchange(i,j); // When the compiler gets to this line, it generates a concrete instance, // with signature exchange(int,int). This version of exchange, with eltType<-int will have its code included in the object code double x=3.24,y=11.98; exchange(x,y); // When the compiler gets to this line, it generates a concrete instance, with signature exchange(double,double). // This version of exchange, with eltype<-double will have its code included in the object code exchange(i,x); // When the compiler gets to this line, it can't generate a concrete instance, because eltType is unclear; // one parameter is int, the other double. No code can be generated for exchange(int,double) }