3
我会很感激帮助搞清楚一个模板参数是什么这个问题的问世在我的代码,我已经减少了以下事情:错误:类模板部分特例包含无法推断
typedef unsigned short ushort;
template<typename T = ushort*>
struct Foo
{
};
// Specialization -- works when not a specialization
template<
template<typename,typename> class Container ,
template<typename , template<typename,typename> class> class MetaFunction
>
struct Foo<Container<ushort,typename MetaFunction<ushort,Container>::Type> >
{
//typedef Container<ushort,typename MetaFunction<ushort,Container>::Type> TestType; // OK
};
int main()
{
}
在编译时(GCC 5.4.0),我得到的错误:
Test.cpp:14:8: error: template parameters not deducible in partial specialization:
struct Foo<Container<ushort,typename MetaFunction<ushort,Container>::Type> >
^
Test.cpp:14:8: note: ‘template<class, template<class, class> class<template-parameter-2-2> > class MetaFunction’
奇怪的是,争论Container<ushort,typename MetaFunction<ushort,Container>::Type>
向专业化似乎是有效的。