int main() { Foo f; f.print(5); f.printNonInline(10); friendedPrinter(f, 15); return 0; }
int main(int argc, char** argv) { Foo<Bar> f; f.print(); Foo<Car> f2; f2.print2(); return 0; }
int main( void ) { Foo<double, double> a; Foo<double, float > b; Foo<float , double> c; Foo<int , int > d; a.print(); //==> this is T1 T2 structure. b.print(); //==> this is T1 float structure. c.print(); //==> this is float T2 structure. d.print(); //==> this is int int structure. func( 1.0 , 2.0 ); //==> this is T1 T2 function. func( 1.0 , 2.0f ); //==> this is T1 float function. func( 1.0f, 2.0 ); //==> this is float T2 function. func( 1 , 2 ); //==> this is int int function. return 0; }
void someSub(Foo foo) { foo.print(); }