2
Вот простейший случай того, что я пытаюсь сделать:См собственного типа для параметра шаблона шаблона
template <template <typename...> class Wrapper>
struct WrapperTraits { };
template <typename... Whatever>
struct Foo {
private:
// I want Foo here to refer to the template, and not the current
// concrete type (which is injected into the namespace by default)
using Traits = WrapperTraits<Foo>;
};
int main()
{
return 0;
}
А вот ошибка лязга 3.6 (он компилирует штраф на GCC 4.8 и 5.2):
error: template argument for template template parameter must be a class template or type alias template
using Traits = WrapperTraits<Foo>;
^
1 error generated.
Compilation failed
Вот пример вопроса о godbolt: https://goo.gl/cSx6QR
Спасибо за вашу помощь!
'шаблона с использованием Foo_Z = Foo ,' затем использовать 'Foo_Z'? –
Yakk
не может воспроизвести ошибку: https://ideone.com/rXiUhl – user463035818
@ tobi303 Это на gcc 5.1. Он не компилируется на clang. Я предоставил ссылку на godbolt –