如何定义矢量
how to define a vector
我在类的头文件中得到了以下内容:
#include <vector>
#include <math.h>
在类描述中,我有以下受保护的成员:
vector<Point2D> samples;
Point2D被定义为类
在编译期间,我得到了很多错误(C2143、C4430和C2238)
有什么想法吗?
除非在代码的其他部分定义名称空间,否则需要使用std::vector
。
#include <vector>
#include <math.h>
...
std::vector<Point2D> samples;
您需要链接到标准Vector。std::vector
相关文章:
- 在类定义之后定义一个私有方法
- Android Studio:如何在build.gradle中定义自定义宏(针对不同的构建变体),并让原生C / C++
- 如何定义自定义生成配置类型,其中通常是.exe的目标改为 DLL
- 嵌套定义与定义的参数 C++
- C++定义自定义unordered_set的不同方法
- C++ - 重新定义/以前定义的错误
- 是否有解决方法可以在 c++ 中为 short 定义用户定义的文字?
- 如何为 std::unordered_set 定义自定义键等效谓词?
- 当类和函数具有单独的模板参数时,在类定义之外定义友元函数
- 如何使用 QListIterator 的声明自定义类型定义
- 类型定义重定义错误
- 如何从设备代理定义自定义片段
- 如何定义自定义跨平台size_t类型
- C++最接近追溯定义已定义类的超类是什么?
- boost :: fibonacci_heap:带有比较器重新定义圆形定义错误的嵌套定义
- C++ - 定义自定义新建和删除运算符时make_shared
- 用于定义类型定义的可变参数模板(使用 C++11)
- 我如何使用explicit模板实例化用于类定义中定义的模板成员函数
- 定义未定义的行为
- 定义具有定义(x)的宏