MSVC 2010 を使用すると、次の動作が得られます。
template <class T> class Boogy
{
public:
void Fn( T in )
{
}
void Fn2( const T& in)
{
}
};
template <> void Boogy<int>::Fn( int in ) //builds ok
{
}
template <> void Boogy<int*>::Fn( int* in ) //builds ok
{
}
template <> void Boogy<int>::Fn2( const int& in ) //builds ok
{
}
template <> void Boogy<int*>::Fn2( const int*& in ) //DOES NOT BUILD
{
}
typedef int* intStar;
template <> void Boogy<intStar>::Fn2( const intStar& in ) //builds ok
{
}
明らかに、問題を解決するために「ハック」を思いついたのですが、なぜハックが必要なのですか? そして、これを行う必要がありますか?私がいるコードベースには、テンプレートクラスがクラス全体ではなく、メンバー関数の一部を特殊化したインスタンスが多数あります。同僚は、これは許可されていないと断言しています。
ティア。