类模板包含在另一个类模板C 中

Class template included in another Class template C++

本文关键字:包含 另一个      更新时间:2023-10-16

我正在尝试在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 标志,如果不,则必须在两个>>

之间写下它