そこで、次のヘッダー ファイルを作成します。
namespace A
{
template<int a>
void foo(...)
{
//This throws a "test was not declared in this scope" error:
boost::function< bool (int, int)> t = test<a>;
}
template<int a>
bool test(int c, int d)
{
//Do stuff;
}
}
ただし、コンパイル時にエラーがスローされますが、その理由はわかりません。テストは明らかに範囲内です。
orに置き換えtest<a>
ても機能しません。boost:ref(test<a>)
&test<a>
何か案は?