Andrei Tita
Andrei Tita

Reputation: 1236

Bug in variadic function template specialization with MSVC?

Using the Visual Studio Nov 2012 CTP, which supports variadic templates (among other things). The following code:

template<int, typename... Args>
void myfunc(Args... args)
{
}

template<>
void myfunc<1, float>(float)
{
}

produces the following errors:

error C2785: 'void myfunc(Args...)' and 'void myfunc(float)' have different return types
error C2912: explicit specialization 'void myfunc(float)' is not a specialization of a function template

(yeah, the first one is pretty funny)

So my questions are:

1) Am I writing legal C++11 here?

2) If yes, is there a way to find out if this is a known bug in MSVC before submitting it?

Upvotes: 3

Views: 290

Answers (1)

ecatmur
ecatmur

Reputation: 157314

  1. This is perfectly legitimate code; both gcc-4.7.2 and clang 3.0 accept it.

  2. Try searching Microsoft Connect.

Upvotes: 2

Related Questions