Is the following statement a function overload or a function partial specialization?
boost, c++, stl
Solution
There's no such thing as a function partial specialisation. It's an overload.
e.g.
template <typename T, typename U>
void foo(T t, U u);
template <typename T>
void foo<T, int>(T t, int u); // Illegal: no partial specialisation of functions
template <typename T>
void foo(T t, int u); // OK
Be careful when mixing specialisations with overloads, as it doesn't always work the way you may think it does.
Problem
``` template <typename Function> void for_each_element( const boost::tuples::null_type&, Function) {} template <typename Tuple, typename Function> void for_each_element(Tuple& t, Function func) { func(t.get_head()); for_each_element(t.get_tail(),func); } ``` Given the above code snippet, do we define a overload function or a partially specialized function? Thank you