function template overload resolutions
Hello As functions templates cannot be partially specialized, Sutter(05) advices that one can use overload resolution instead: I have // header N.h namespace A { namespace B { namespace C { template<typename cT, typename tT, int n> void make(const cT&, const tT&, const Head<n>& h) {...} } } } // header 3.h namespace A { namespace B { namespace C { template<typename cT, typename tT> void make(const cT&, const tT&, const Head<3>& h) {...} } } } // header 2.h namespace A { namespace B { namespace C { template<typename cT, typename tT> void make(const cT&, const tT&, const Head<2>& h) {...} } } } // Translation unit #include N.h #include 3.h #include 2.h //in this order A::B::C::make(...) The overload resolution is done on the Head<n>&, Head<2>&, Head<3>... Is it sensitive to order of inclusion? rds,
participants (1)
-
Hicham Mouline