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

          <bdo id='B8awb'></bdo><ul id='B8awb'></ul>
        <legend id='B8awb'><style id='B8awb'><dir id='B8awb'><q id='B8awb'></q></dir></style></legend>

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

      1. Eclipse-CDT:在自动生成的包含防护中使用命名空间

        Eclipse-CDT: Use Namespace in automatic generated include-guards(Eclipse-CDT:在自动生成的包含防护中使用命名空间)

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

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

                  本文介绍了Eclipse-CDT:在自动生成的包含防护中使用命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以(以及如何)在 Eclipse CDT,在使用 .hpp/.cpp 模板创建新类时?

                  Is it possible (and how) to add the namespace in the name of the automatic generated include guards in Eclipse CDT, when creating a new class using the .hpp/.cpp templates?

                  对我来说,Eclipse 很好地生成了一个带有命名空间的新类,但是包含保护不包含命名空间,所以如果同一个头文件在两个不同的目录中存在两次,则只能包含一个.

                  For me Eclipse generates a new class with a namespace nicely, but the include guards do not contain the namespace, so if the same header file exists twice in two different directories, only one can be included.

                  在我的例子中,命名空间的名称、Eclipse 项目名称和源目录的名称都是相同的,因此这些可以作为包含保护的前缀的替代方案.

                  In my case the name of the namespace, the Eclipse project name and the name of the source directory are all the same, so these could be alternatives as prefix for the include guard.

                  推荐答案

                  所以在 C/C++ -> Code Style -> Code Templates 下的 Preferences 对话框中,您可以修改模板以更接近您的需要,例如,如果你需要守卫中的命名空间,你可以做类似的事情.

                  So in the Preferences dialog under C/C++ -> Code Style -> Code Templates you can modify the template to be closer to what you need, for example if you need the namespace in the guard, you can do something like.

                  ${filecomment}
                  
                  #ifndef ${namespace_name}_${include_guard_symbol}
                  #define ${namespace_name}_${include_guard_symbol}
                  
                  ${includes}
                  
                  ${namespace_begin}
                  
                  ${declarations}
                  
                  ${namespace_end}
                  
                  #endif /* ${namespace_name}_${include_guard_symbol} */`
                  

                  这篇关于Eclipse-CDT:在自动生成的包含防护中使用命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Eclipse gets stuck when trying to launch Android app(Eclipse 在尝试启动 Android 应用程序时卡住了)
                  Eclipse: Failed to initialize Monitor Thread: Unable to establish loopback connection(Eclipse:无法初始化监视器线程:无法建立环回连接)
                  Eclipse- JDK not found(Eclipse-找不到JDK)
                  How to make Eclipse behave well in the Windows 7 taskbar?(如何让 Eclipse 在 Windows 7 任务栏中表现良好?)
                  FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)(本机方法中的致命错误:JDWP 未初始化传输,jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197))
                    1. <i id='OISlI'><tr id='OISlI'><dt id='OISlI'><q id='OISlI'><span id='OISlI'><b id='OISlI'><form id='OISlI'><ins id='OISlI'></ins><ul id='OISlI'></ul><sub id='OISlI'></sub></form><legend id='OISlI'></legend><bdo id='OISlI'><pre id='OISlI'><center id='OISlI'></center></pre></bdo></b><th id='OISlI'></th></span></q></dt></tr></i><div id='OISlI'><tfoot id='OISlI'></tfoot><dl id='OISlI'><fieldset id='OISlI'></fieldset></dl></div>
                      <tfoot id='OISlI'></tfoot>

                            <tbody id='OISlI'></tbody>

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

                        1. <legend id='OISlI'><style id='OISlI'><dir id='OISlI'><q id='OISlI'></q></dir></style></legend>
                            <bdo id='OISlI'></bdo><ul id='OISlI'></ul>