你能用 C++ 中的 Enum 类替换 Typename 吗?

问题描述

我创建了一个名为 Colour 的枚举类

enum Colour{
    RED,YELLOW,GREEN,BLUE,WHITE
}; 

现在我正在创建一个名为 Row 的模板类。这个“行”类应该针对某种颜色进行模板化。

这是我迄今为止在代码中编写的内容

#include <iostream>
#include "Colour.h"

template <Colour T> class QwintoRow; 
template <Colour T> ostream& operator<<(ostream&,const QwintoRow<T> &qr);

template <Colour T> 
class QwintoRow{

// stuff
};

我想我的问题是,这段代码有意义吗?我有点困惑你什么时候会写

template <Typename T>
template <Class T>

写模板有意义吗?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)