<legend id='hTrQI'><style id='hTrQI'><dir id='hTrQI'><q id='hTrQI'></q></dir></style></legend>
    • <bdo id='hTrQI'></bdo><ul id='hTrQI'></ul>
    <i id='hTrQI'><tr id='hTrQI'><dt id='hTrQI'><q id='hTrQI'><span id='hTrQI'><b id='hTrQI'><form id='hTrQI'><ins id='hTrQI'></ins><ul id='hTrQI'></ul><sub id='hTrQI'></sub></form><legend id='hTrQI'></legend><bdo id='hTrQI'><pre id='hTrQI'><center id='hTrQI'></center></pre></bdo></b><th id='hTrQI'></th></span></q></dt></tr></i><div id='hTrQI'><tfoot id='hTrQI'></tfoot><dl id='hTrQI'><fieldset id='hTrQI'></fieldset></dl></div>
  • <small id='hTrQI'></small><noframes id='hTrQI'>

    1. <tfoot id='hTrQI'></tfoot>

        为什么要加入守卫?

        时间:2023-09-19

          <tfoot id='aTJ8v'></tfoot>
          1. <i id='aTJ8v'><tr id='aTJ8v'><dt id='aTJ8v'><q id='aTJ8v'><span id='aTJ8v'><b id='aTJ8v'><form id='aTJ8v'><ins id='aTJ8v'></ins><ul id='aTJ8v'></ul><sub id='aTJ8v'></sub></form><legend id='aTJ8v'></legend><bdo id='aTJ8v'><pre id='aTJ8v'><center id='aTJ8v'></center></pre></bdo></b><th id='aTJ8v'></th></span></q></dt></tr></i><div id='aTJ8v'><tfoot id='aTJ8v'></tfoot><dl id='aTJ8v'><fieldset id='aTJ8v'></fieldset></dl></div>
              <bdo id='aTJ8v'></bdo><ul id='aTJ8v'></ul>

                <legend id='aTJ8v'><style id='aTJ8v'><dir id='aTJ8v'><q id='aTJ8v'></q></dir></style></legend>
                  <tbody id='aTJ8v'></tbody>

                <small id='aTJ8v'></small><noframes id='aTJ8v'>

                  本文介绍了为什么要加入守卫?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  包含守卫,如此处所定义,用于防止两次加载相同的代码编译.

                  Include guards, as defined here, are used to prevent loading the same code twice at compilation.

                  为什么我的编译器 (GCC) 无法检测到它正在加载相同的代码两次并且具有合理的默认行为?

                  Why can't my compiler (GCC) detect that it is loading the same code twice and have a sensible default behaviour?

                  推荐答案

                  很简单,因为您可能希望编译器加载该文件两次.

                  Simply because you might have wanted the compiler to load that file twice.

                  请记住,#include 只是加载一个文件并将其内容放在指令的位置.该文件可能是头文件,但也可能是有用且经常使用的源代码.

                  Remember, that #include simply loads a file and puts its contents in the place of the directive. This file might be a header file, but may be useful and frequently used piece of source code as well.

                  大多数现代编译器对 #pragma once 做出反应,完全按照您的意愿行事.但请记住,这是一个未包含在语言规范中的编译器扩展,坚持包含保护通常是个好主意 - 您会确定它适用于所有编译器和任何情况.

                  Most modern compilers react to #pragma once doing exactly what you want them to. Remember though, that this is a compiler extension not included in the language specification and it is generally a good idea to stick to include guards - you'll be certain, that it works on every compiler and in any circumstances.

                  这篇关于为什么要加入守卫?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:GCC ABI 兼容性 下一篇:g++ -fdump-class-hierarchy 的输出中的第一个 (int (*)(

                  相关文章

                  最新文章

                • <tfoot id='I2h66'></tfoot>
                • <legend id='I2h66'><style id='I2h66'><dir id='I2h66'><q id='I2h66'></q></dir></style></legend>
                    <bdo id='I2h66'></bdo><ul id='I2h66'></ul>

                    <i id='I2h66'><tr id='I2h66'><dt id='I2h66'><q id='I2h66'><span id='I2h66'><b id='I2h66'><form id='I2h66'><ins id='I2h66'></ins><ul id='I2h66'></ul><sub id='I2h66'></sub></form><legend id='I2h66'></legend><bdo id='I2h66'><pre id='I2h66'><center id='I2h66'></center></pre></bdo></b><th id='I2h66'></th></span></q></dt></tr></i><div id='I2h66'><tfoot id='I2h66'></tfoot><dl id='I2h66'><fieldset id='I2h66'></fieldset></dl></div>
                    1. <small id='I2h66'></small><noframes id='I2h66'>