Home Dashboard Directory Help
Search

C++ Variadic Template-Template Fail to Compile VS2012 Nov 2012 CTP by Vass Nándor


Status: 

Closed


4
0
Sign in
to vote
Type: Bug
ID: 771567
Opened: 11/18/2012 11:10:18 PM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

The following code fails to compile using Microsoft Visual C++ Compiler Nov 2012 CTP

#include <tuple>

class A
{
public:
    template <class... Fs, template <class...> class T>
    void foo(T<Fs...>);
};

template <class... Fs, template <class...> class T>
void A::foo(T<Fs...>)
{
}

int main()
{
    A a;
    a.foo(std::make_tuple(10,10));
}

it gives the following error:

error C2244: 'A::foo' : unable to match function definition to an existing declaration
definition
'void A::foo(T<Fs...>)'
existing declarations
'void A::foo(T<Fs...>)'
Details
Sign in to post a comment.
Posted by Microsoft on 2/19/2013 at 9:08 AM
Hi: this issue has been fixed. The fix will show up in the next release of Visual C++.

Thanks
Jonathan Caves
Visual C++ Compiler Team
Posted by Vass Nándor on 1/29/2013 at 3:52 AM
template <class R, class T>
class C
{
};

class A
{
public:
    template <class... Fs, template <class...> class T>
    void foo(T<Fs...>);
};

template <class... Fs, template <class...> class T>
void A::foo(T<Fs...>)
{
}

int main()
{
    A a;
    C<int,int> c;
    a.foo(c);
}

produces the same error, but you don't even need to call the function (empty main body) it will still fail to compile.
Posted by UnitUniverse on 1/21/2013 at 3:57 AM
Currently the tuple class in the std library is not variadic template compatible and working in old macro extraction way. This will change in the future. i think it is not a bug and all we canna do is wait.
Posted by Microsoft on 11/19/2012 at 9:42 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 11/19/2012 at 9:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.