Вложенный шаблон и определение параметров [дубликаты]
Возможный дубликат:
Обходной путь для невыгружаемого контекста
GCC не может определить параметры для этогопросто' функция. Есть ли способ немного помочь компилятору?
template struct A
{
template struct B
{
};
};
template void test(typename A<a>::template B param) { }
int main()
{
A::B b;
test(b); // works
test(b); // doesn't work
}
</a>
сообщение об ошибке от GCC 4.7.1:
test.cpp: In function 'int main()': test.cpp:15:8: error: no matching function for call to 'test(A::B&)' test.cpp:15:8: note: candidate is: test.cpp:8:29: note: template void test(typename A
<a>::B) test.cpp:8:29: note: template argument deduction/substitution failed: test.cpp:15:8: note: couldn't deduce template parameter 'a' </a>