How to cast overloaded free function to resolve overload conflict?

c++

Solution

You could cast or use a local function pointer variable.

void (*p)(dog) = do_something;
do_something_template(p);
do_something_template(static_cast<void(*)(cat)>(do_something));

Problem

Say you have 2 free functions: ``` void do_something(dog d); void do_something(cat c); ``` No say you want to pass these functions to a templated function: ``` template <typename DoSomethingFunc> void do_something_template(DoSomethingFunc func); ``` What would be the preferred way to call `do_something_template` in a manner that avoids overload resolution conflicts? Would it be casting?

Original source