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

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

      2. <tfoot id='Grgkw'></tfoot>

        如何从 boost::shared_ptr 释放指针?

        How to release pointer from boost::shared_ptr?(如何从 boost::shared_ptr 释放指针?)
        <tfoot id='woNqk'></tfoot>

            <tbody id='woNqk'></tbody>

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

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

                <bdo id='woNqk'></bdo><ul id='woNqk'></ul>
                  本文介绍了如何从 boost::shared_ptr 释放指针?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  boost::shared_ptr 可以释放存储的指针而不删除它吗?

                  Can boost::shared_ptr release the stored pointer without deleting it?

                  我可以看到文档中不存在发布功能,在常见问题解答中也解释了为什么它不提供发布功能,例如不能在非唯一指针上进行发布.我的指针是独一无二的.我怎样才能释放我的指针?或者使用哪个 boost 智能指针类可以让我释放指针?我希望你不会说使用 auto_ptr :)

                  I can see no release function exists in the documentation, also in the FAQ is explained why it does not provide release function, something like that the release can not be done on pointers that are not unique. My pointers are unique. How can I release my pointers ? Or which boost smart pointer class to use that will allow me releasing of the pointer ? I hope that you won't say use auto_ptr :)

                  推荐答案

                  您需要使用一个删除器,您可以请求不删除底层指针.

                  You need to use a deleter that you can request not to delete the underlying pointer.

                  看到这个答案(已经标记为与此问题重复)以获取更多信息.

                  See this answer (which has been marked as a duplicate of this question) for more information.

                  这篇关于如何从 boost::shared_ptr 释放指针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to print vector#39;s data(如何打印矢量的数据)
                  Visual C++ appends 0xCC (int3) bytes at the end of functions(Visual C++ 在函数末尾附加 0xCC (int3) 字节)
                  How to use a variable inside a _T wrapper?(如何在 _T 包装器中使用变量?)
                  MSVC++ warning flags(MSVC++ 警告标志)
                  How to read file which contains uxxxx in vc++(如何在vc++中读取包含uxxxx的文件)
                  stack overflow error in C++ program(C++程序中的堆栈溢出错误)

                  <small id='4dK3x'></small><noframes id='4dK3x'>

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