<legend id='8Kzw0'><style id='8Kzw0'><dir id='8Kzw0'><q id='8Kzw0'></q></dir></style></legend>
  • <small id='8Kzw0'></small><noframes id='8Kzw0'>

    <tfoot id='8Kzw0'></tfoot>

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

      1. 引导“::"的目的是什么?在 C++ 方法调用中

        What#39;s the purpose of a leading quot;::quot; in a C++ method call(引导“::的目的是什么?在 C++ 方法调用中)
        <i id='zMHGv'><tr id='zMHGv'><dt id='zMHGv'><q id='zMHGv'><span id='zMHGv'><b id='zMHGv'><form id='zMHGv'><ins id='zMHGv'></ins><ul id='zMHGv'></ul><sub id='zMHGv'></sub></form><legend id='zMHGv'></legend><bdo id='zMHGv'><pre id='zMHGv'><center id='zMHGv'></center></pre></bdo></b><th id='zMHGv'></th></span></q></dt></tr></i><div id='zMHGv'><tfoot id='zMHGv'></tfoot><dl id='zMHGv'><fieldset id='zMHGv'></fieldset></dl></div>

            <tbody id='zMHGv'></tbody>

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

              <tfoot id='zMHGv'></tfoot>
            1. <legend id='zMHGv'><style id='zMHGv'><dir id='zMHGv'><q id='zMHGv'></q></dir></style></legend>

                <bdo id='zMHGv'></bdo><ul id='zMHGv'></ul>
                  本文介绍了引导“::"的目的是什么?在 C++ 方法调用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在使用 Boost 库,在 Boost.Exception 中,我注意到如下代码:

                  I've been using the Boost libraries, and in Boost.Exception, I've noticed code like the following:

                  #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
                  

                  只是出于好奇:boost::throw_exception(x)之前的前导::的目的是什么?

                  Just out of curiosity: what is the purpose of the leading :: before boost::throw_exception(x)?

                  推荐答案

                  引用根命名空间.如果您的类或命名空间使用的名称也存在于根目录中,但在某些时候您希望引用根版本,这通常很有用.

                  To refer to the root namespace. This is often useful if your class or you namespace uses a name which also exists in the root, but at some point you wish to refer to the root version.

                  例如,如果我在类中重载了 new,但希望在某个时候引用默认(根)new,那么我将使用 ::new 来引用 root new.

                  For example, if I have overloaded new in my class, but wish at some point to refer to the default (root) new, then I would use ::new to refer to root new.

                  这篇关于引导“::"的目的是什么?在 C++ 方法调用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                  Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                  STL BigInt class implementation(STL BigInt 类实现)
                  Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                  Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                  Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)

                    <tfoot id='1Im9H'></tfoot>

                    <small id='1Im9H'></small><noframes id='1Im9H'>

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