C++收割台防护装置
C++ Header Guards
假设我有以下头文件:
#ifndef TESTCLASS_H
#define TESTCLASS_H
#include <string>
class TestClass
{
public:
TestClass();
std::string test();
};
#endif // TESTCLASS_H
我是否也必须在#include <string>
周围设置警卫?如果没有,如果main.cpp也有#include <string>
怎么办?
否,因为string
头文件有自己的包含保护(所有合理库的头文件也是如此)。
没有必要,c++标准库有自己的Guard。
相关文章:
- 我可以以某种方式使我的矢量/数组动态更改装置数量吗?
- Box2D-从身体中获取固定装置的宽度,或者我什至应该尝试
- 在Google测试固定装置中使用参考代替指针
- 访问Google测试固定装置会员
- 类和对象在C++..需要一些额外的固定装置
- 重叠的收割台夹杂物
- 大型机组的动力装置
- 何时使用包括防护装置或 #pragma 一次C++
- 喷漆装置返回引擎== 0,类型:1
- C++收割台防护装置
- Boost.Regex联动装置错误LUbuntu 14.04 g++4.8.2
- 推力装置矢量的推力装置矢量<int>
- 是否应该在氧气文件前放置包括防护装置
- C预处理器防护装置
- CUDA推力装置绑带
- 使用文本装置——谷歌测试
- 正确地包括收割台
- C++LNK2019(包括收割台时)
- NVidia推力装置_弦矢量