Pra*_*tic 13 c++ standards c-preprocessor c++11
TC对这个问题的回答留下了一个有趣的评论:
TC说:
有"标题",还有"源文件"."标题"不需要是实际文件.
这是什么意思?
仔细阅读标准,我看到对"头文件"和"标题"的大量引用.但是,关于#include,我注意到该标准似乎引用了"标题"和"源文件 ".(C++ 11,§16.2)
A preprocessing directive of the form
# include < h-char-sequence> new-line
searches a sequence of implementation-defined places for a header identified uniquely
by the specified sequence between the < and > delimiters, and causes the replacement
of that directive by the entire contents of the header. How the places are specified
or the header identified is implementation-defined.
Run Code Online (Sandbox Code Playgroud)
和
A preprocessing directive of the form
# include " q-char-sequence" new-line
causes the replacement of that directive by the entire contents of the source *file*
identified by the specified sequence between the " delimiters. The named source *file*
is searched for in an implementation-defined manner.
Run Code Online (Sandbox Code Playgroud)
我不知道这是否重要.可能是C++上下文中的"标题"明确地表示"头文件",但单词"sources"将是不明确的,因此"标题"是简写,但"来源"不是.或者可能是C++编译器允许支架包含的余地,只需要像发生文本替换一样.
那么什么时候标题(文件)不是文件?
TC在以下评论中提到的脚注非常直接:
174)标题不一定是源文件,标题名称中<和>分隔的序列也不一定是有效的源文件名(16.2).