templates to be defined explicitly
Do we need to define templates explicitly for each function/class
like
template<class X>
myfun1(X x){}
template<class X>
myfun2(X x){}
template<class X>
class myclass1{ X x; };
template<class X>
class myclass2{ X x; };
--------------------
OR could we define template once and start using it repeatedly
like
template<class X>
myfun1(X x){}
myfun2(X x){}
class myclass1{ X x; };
class myclass2{ X x; };
Topic archived. No new replies allowed.