如何拥有在当前类之后定义的类的变量
How to have a variable of a class which has been defined after current class?
这是我的c++ CLI代码:
public ref class SVeh{
public:
bool Is( Pla^ For);
};
Pla
在SVeh
之后定义。
public ref class Pla{
public:
bool somemethod();
};
编译器将Pla
类作为未知标识符,不进行编译。如何解决这个问题?
我不知道c++/CLI,但如果它类似于c++,你可以向前声明Pla:
ref class Pla;
public ref class SVeh{
// rest of code
相关文章:
- 在类定义之后定义一个私有方法
- 类的前向声明之后的类成员函数定义,在类声明之前
- 为什么即使在定义之后仍存在"Identifier is undefined error "?
- 实例化具有不完整类型的类模板格式不正确(如果该类型是在之后定义的)
- 在 ss.clear() 之后使用 ss.str( " ") 用于新定义的字符串流
- 在这个节点定义中,为什么我们在结构定义之后使用"Node"?
- 预处理之后和使用CMake编译之前的自定义构建步骤
- C 以任何方式将类定义放置在main()函数之后
- 为什么编译器在我定义_CRT_SECURE_NO_WARNINGS之后仍然警告我不安全的strtok
- 不能在嵌套类中使用父类 - 即使之后定义了嵌套类
- 标识符在包含头之后使用未定义的类
- 在包含windows.h:语法错误之后无法定义枚举
- 是在类定义之后允许的类声明
- 在定义成员类之后重新声明它是否合法?
- 未定义的引用错误,即使在链接c文件之后
- 在结构类型之后定义结构变量
- 为什么main()函数之后的类定义不能工作
- 我应该在知道我将使用多少个元素之前还是之后定义向量中的元素数?
- 如何拥有在当前类之后定义的类的变量
- 在对象定义之后调用构造函数