VS 2013.1 не будет расширять шаблон

template <class T>
struct identity
{
virtual ~identity() {}
typedef T type;
};

template <class T>
struct _function_signature : _function_signature<decltype(&T::operator())>
{};

template <class R, class... A>
struct _function_signature<R(A...)> : identity<R(A...)>
{};

Этот кусок кода прекрасно компилируется в g++ но отказывается делать это в msvc со следующей ошибкой:

error C3520: 'A' : parameter pack must be expanded in this context

ms vs ultimate 2013 v 12.0.30110.00 update 1
g++ (rev5, Built by MinGW-W64 project) 4.8.1

Полная версия ошибок:

1>------ Build started: Project: tests, Configuration: Debug Win32 ------
1>  main.cpp
1>d:\projects\tests\tests\main.cpp(30): error C3520: 'A' : parameter pack must be expanded in this context
1>          d:\tests\tests\main.cpp(162) : see reference to class template instantiation 'fl<void (void),>' being compiled
1>d:\projects\tests\tests\main.cpp(38): error C3520: 'A' : parameter pack must be expanded in this context
1>d:\projects\tests\tests\main.cpp(46): error C3520: 'A' : parameter pack must be expanded in this context
1>d:\projects\tests\tests\main.cpp(54): error C3520: 'A' : parameter pack must be expanded in this context
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Компиляция версии на сложены криво.

2

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector