Вложенный шаблон и определение параметров [дубликаты]

Possible Duplicate:
Workaround for non-deduced context

GCC не может определить параметры для этого «простого» функция. Есть ли способ немного помочь компилятору?

template<int a> struct A
{
    template<int b> struct B
    {
    };
};

template<int a, int b> void test(typename A<a>::template B<b> param) { }

int main()
{
    A<1>::B<2> b;

    test<1,2>(b); // works
    test(b);      // doesn't work
}

сообщение об ошибке от GCC 4.7.1:

test.cpp: In function 'int main()':
test.cpp:15:8: error: no matching function for call to 'test(A<1>::B<2>&)'
test.cpp:15:8: note: candidate is:
test.cpp:8:29: note: template<int a, int b> void test(typename A<a>::B<b>)
test.cpp:8:29: note:   template argument deduction/substitution failed:
test.cpp:15:8: note:   couldn't deduce template parameter 'a'

Ответы на вопрос(1)

Ваш ответ на вопрос