#include <iostream>
namespace ns
{
template <typename T1, typename T2>
//----------------------------vv---------------->i added this {} for making this a definition
void foo(T1 v1, T2 v2){};
}
template <typename T1, typename T2>
void baz(T1 v1, T2 v2)
{ ns::foo(v1, v2); }
template <typename T1>
struct SZug
{
template <typename T2>
void zug(T2 v2)
{
T1 v1;
baz(v1, v2);
}
};
// SFyp overload of foo().
struct SFyp{};
namespace ns
{
template <typename T2>
void foo(SFyp fyp, T2 v2)
{}
}
// Test.
int main()
{
SZug<SFyp> z;
z.zug(1);
}
namespace Custom
{
template<typename T>
void foo(T)
{
std::cout << "foo called" << std::endl;
}
}