namespace MyNS
{
//省略

template<typename int_t>
class MyTempl;

template <typename hoge_t, typename boke_t>
hoge_t foo(const boke_t& arg);

template<typename int_t>
class MyTempl
{
public :

int_t num;

MyTempl(int_t n = 0) : num(n) {}


template <typename hoge_t>
friend hoge_t foo(const MyTempl<int_t>& arg)//問題の箇所1
{
return static_cast<hoge_t>(arg.num.num);
}
};
}//namespace MyNS