跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 请问大家, boost::shared_ptr 无法赋值为 null 么
未分類
12 1 月 2021

请问大家, boost::shared_ptr 无法赋值为 null 么

请问大家, boost::shared_ptr 无法赋值为 null 么

資深大佬 : wohenfuyou 0

/home/d5000/kedong/src/app/xcp_container/src/PModelContainer.cpp:34: 错误:对 ‘ControlArea::setParentControlArea(NULL)’ 的调用没有匹配的函数
/home/d5000/kedong/src/app/xcp_container/include/ControlArea.h:25: 附注:备选为:void ControlArea::setParentControlArea(boost::shared_ptr<ControlArea>)

以上是编译错误
ControlArea 是个类

大佬有話說 (7)

  • 資深大佬 : wutiantong

    不是 NULL,是 nullptr

  • 主 資深大佬 : wohenfuyou

    @wutiantong 我得编译器不支持 nullptr,请问有其他方法么

  • 資深大佬 : HannibaI

    shared_ptr::reset()

  • 資深大佬 : exiledkingcc

    {}

  • 資深大佬 : wutiantong

    @wohenfuyou 其他方法就是上那样的,也就是 boost::shared_ptr<ControlArea>()

  • 主 資深大佬 : wohenfuyou

    好的 谢谢大家

  • 資深大佬 : cholerae

    clang 3.0/gcc 4.6 就支持 nullptr 了,这得是多老的编译器。。。

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具