<legend id='mREWq'><style id='mREWq'><dir id='mREWq'><q id='mREWq'></q></dir></style></legend>

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

      <tfoot id='mREWq'></tfoot>

      • <bdo id='mREWq'></bdo><ul id='mREWq'></ul>

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

      前置双冒号“::"是什么意思?

      What is the meaning of prepended double colon quot;::quot;?(前置双冒号“::是什么意思?)
    1. <i id='YXJEt'><tr id='YXJEt'><dt id='YXJEt'><q id='YXJEt'><span id='YXJEt'><b id='YXJEt'><form id='YXJEt'><ins id='YXJEt'></ins><ul id='YXJEt'></ul><sub id='YXJEt'></sub></form><legend id='YXJEt'></legend><bdo id='YXJEt'><pre id='YXJEt'><center id='YXJEt'></center></pre></bdo></b><th id='YXJEt'></th></span></q></dt></tr></i><div id='YXJEt'><tfoot id='YXJEt'></tfoot><dl id='YXJEt'><fieldset id='YXJEt'></fieldset></dl></div>
      • <legend id='YXJEt'><style id='YXJEt'><dir id='YXJEt'><q id='YXJEt'></q></dir></style></legend>

            <tbody id='YXJEt'></tbody>
            <bdo id='YXJEt'></bdo><ul id='YXJEt'></ul>
            <tfoot id='YXJEt'></tfoot>

            • <small id='YXJEt'></small><noframes id='YXJEt'>

              1. 本文介绍了前置双冒号“::"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在一个必须修改的类中发现了这行代码:

                I found this line of a code in a class which I have to modify:

                ::Configuration * tmpCo = m_configurationDB;//pointer to current db
                

                而且我不知道类名前面的双冒号到底是什么意思.没有它,我会读到:tmpCo 的声明作为指向 Configuration 类的对象的指针......但是前置的双冒号让我感到困惑.

                and I don't know what exactly means the double colon prepended to the class name. Without that I would read: declaration of tmpCo as a pointer to an object of the class Configuration... but the prepended double colon confuses me.

                我还发现:

                typedef ::config::set ConfigSet;
                

                推荐答案

                这可确保从全局命名空间开始解析,而不是从您当前所在的命名空间开始.例如,如果您有两个名为 <代码>配置如下:

                This ensures that resolution occurs from the global namespace, instead of starting at the namespace you're currently in. For instance, if you had two different classes called Configuration as such:

                class Configuration; // class 1, in global namespace
                namespace MyApp
                {
                    class Configuration; // class 2, different from class 1
                    function blah()
                    {
                        // resolves to MyApp::Configuration, class 2
                        Configuration::doStuff(...) 
                        // resolves to top-level Configuration, class 1
                        ::Configuration::doStuff(...)
                    }
                }
                

                基本上,它允许您遍历全局命名空间,因为您的名称可能会被另一个命名空间内的新定义破坏,在本例中为 MyApp.

                Basically, it allows you to traverse up to the global namespace since your name might get clobbered by a new definition inside another namespace, in this case MyApp.

                这篇关于前置双冒号“::"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                Delay Loading DLLs(延迟加载 DLL)
                Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                Loading a dll from a dll?(从 dll 加载 dll?)
                <legend id='W1UIH'><style id='W1UIH'><dir id='W1UIH'><q id='W1UIH'></q></dir></style></legend>
                    <i id='W1UIH'><tr id='W1UIH'><dt id='W1UIH'><q id='W1UIH'><span id='W1UIH'><b id='W1UIH'><form id='W1UIH'><ins id='W1UIH'></ins><ul id='W1UIH'></ul><sub id='W1UIH'></sub></form><legend id='W1UIH'></legend><bdo id='W1UIH'><pre id='W1UIH'><center id='W1UIH'></center></pre></bdo></b><th id='W1UIH'></th></span></q></dt></tr></i><div id='W1UIH'><tfoot id='W1UIH'></tfoot><dl id='W1UIH'><fieldset id='W1UIH'></fieldset></dl></div>

                  1. <small id='W1UIH'></small><noframes id='W1UIH'>

                    • <bdo id='W1UIH'></bdo><ul id='W1UIH'></ul>
                        <tfoot id='W1UIH'></tfoot>
                          <tbody id='W1UIH'></tbody>