Enz*_*nzo 2 c++ header deprecated
我一直收到不赞成的标题警告:
#ifdef __DEPRECATED
#warning This file includes at least one deprecated or antiquated header. \
Please consider using one of the 32 headers found in section 17.4.1.2 of the \
C++ standard. Examples include substituting the <X> header for the <X.h> \
header for C++ includes, or <iostream> instead of the deprecated header \
<iostream.h>. To disable this warning use -Wno-deprecated.
#endif
Run Code Online (Sandbox Code Playgroud)
但是,我没有看到我的项目调用的任何已弃用的标头(包括我的库调用的标头).这些都是我加载头(或者,至少,我看到的): iostream math.h assert.h fstream vector time.h.
在第17.4.1.2节http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf中,只有一个应该使用的标题列表.
1)是否有某个已弃用的列表?
2)关于如何离开预处理器的想法哪一个是他不喜欢的精确标题?
干杯!
来自C世界的标题将以前缀为前缀c,而不是后缀.
这意味着你想要包括cmath,cassert和ctime.
在这些情况下,只有标题名称可能会被弃用,而不是内容.
注意:您可以通过匹配您链接到的文档中的名称来推断哪些标题符合此类弃用.
显然,这仅适用于标准标题.例如,unistd.h永远都是unistd.h.