Специализация шаблона функций в функцию шаблона вариадиадического шаблона

У меня нет проблем, передав адрес специализации шаблона функции на обычный шаблон функции:

template <typename T>
void f(T) {}

template <typename A, typename B>
void foo(A, B) {}

int main()
{
    foo(&f<int>, &f<float>);
}

Однако, когда я пытаюсь пройти те же специалисты на вариационную шаблону:

template <typename T>
void f(T) {}

template <typename... A>
void bar(A...) {}

int main()
{
    bar(&f<int>, &f<float>);
}

Я получаю Следующие ошибки компилятора с GCC (я пробовал 4.6.1 и 4.7.0):

test.cpp: In function 'int main()':
test.cpp:9:27: error: no matching function for call to 'bar(<unresolved overloaded function type>, <unresolved overloaded function type>)'
test.cpp:9:27: note: candidate is:
test.cpp:5:6: note: template<class ... A> void bar(A ...)
test.cpp:5:6: note:   template argument deduction/substitution failed:

Почему я получаю эти ошибки?

7
задан HC4 - reinstate Monica 12 September 2011 в 21:25
поделиться