类模板包含在另一个类模板C 中
Class template included in another Class template C++
我正在尝试在C 中编程,并且我的情况如下:
template<Class U>;
Class A<U>;
Class B;
我需要执行该代码:
A<A<B>> x;
,但我得到了错误:
error: template argument 1 is invalid
warning: >> operator will be treated as two right angle brackets in C++
我也尝试了:
A<(A<B>)> x;
,但仍然不起作用。我该如何管理?
A<A<B>> x;
应该起作用,只需添加
-std=c++14
或
-std=c++11
到g 标志,如果不,则必须在两个>>
相关文章:
- 如何将包含另一个对象向量的对象保存到文件中,并使用C++中的二进制文件从文件中读回?
- 创建一个 const std::vector ,其中包含另一个 const std::vector 和其他值
- 如何为包含另一个类实例的数组制作常量 getter?
- 使用按位运算确定值是否包含另一个值
- 如何在我的 cmake 项目中包含另一个 cmake 项目的头文件?
- 如何查找哪个标头在包含树中包含另一个标头
- 包含另一个实例的特征实例,该实例持有固定大小的特征对象
- 包含另一个对象的对象,然后将其传递给它(C )
- C++初始化包含另一个对象设计问题的对象
- 程序检查是否包含另一个数字
- 包含另一个对象指针向量的对象
- 当动态创建一个包含另一个动态创建的结构数组的结构数组时,内存管理
- BITWISE-如何检查二进制号是否包含另一个数字
- 包含另一个关键部分的关键部分
- 向量emplace_back包含另一个向量(部分向量)的用法(C++11)
- 在我的 qmake 项目中包含另一个项目的 qmake 文件
- 分配包含另一个结构数组的结构数组时出错
- 检查一个文档是否包含另一个c++的内容
- 检查map<string,string>是否包含另一个map<string,string>
- 将包含另一个向量的结构向量写入二进制文件