当尝试编译这段代码时:
template <class URNG>
struct Dumb : Brain<Dumb, URNG>
{
Move operator()(const Rat<Dumb, URNG>& rat, URNG&& urng)
{
Move move;
move.x = 1;
move.y = 0;
//rat.look(1, 2);
//rat.getDna(35);
return move;
}
};
clang 3.2.7 报错,这是一个我不理解的奇怪错误:
main.cpp:10:28: error: template argument for template template parameter must be a class template or type alias template
Move operator()(const Rat<Dumb, URNG>& rat, URNG&& urng)
^
“Dumb”是一个类模板,对吧?
正如评论中所要求的那样,这里是“rat”的样子:
template <template <class> class BRAIN, class URNG>
class Rat
{
//...
}
Rat
的定义? - Barry