Status, Recent Changes, and Plans 编辑

 

I'm sorry this section is in the way for first-time readers. You may want to skip directly to the Getting Started Guide, the Reference Manual, or the FAQ. I put this section at the top so that checking for recent changes will be easy.

Recent changes to nsCOMPtr

Most recent first

  • Made == and != between an nsCOMPtr and a raw pointer (or a literal 0 or nsnull) work correctly on all compilers. See bug 65664.
  • Made getter_AddRefs( nsCOMPtr& ) apply the same type-safety check that the simple assignment forms do.
  • Added do_CreateInstance.
  • Added do_GetService.
  • Eliminated the need to cast getter_AddRefs when an nsISupports** is needed.
  • Relaxed the invariant for nsCOMPtr<nsISupports>, so that it is now a pointer to any XPCOM interface.
  • Added do_QueryReferent to make using nsIWeakReferences easier.

Plans for nsCOMPtr

  • bug 59212: as soon as we test on more compilers, start recommending already_AddRefed as a function result.
  • bug 59414: making operator& private may help prevent some leaks caused by casting
  • Move the factored nsCOMPtr routines into their own library, to reduce nsCOMPtr clients' dependency on the XPCOM library.

Recent changes to this document

  • Removed the statement that == and != between an nsCOMPtr and a raw pointer or literal 0 does not work on some compilers since it is no longer true.
  • Added an entire section to the Getting Started Guide on nsCOMPtrs in function signatures
  • Added references to recent bugs influencing the use of nsCOMPtr machinery: bug 59212, and bug 59414
  • Fixed comparisons 1 and 3, as per comments by Morten Welinder
  • Updated examples to prefer direct initialization over copy initialization.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:74 次

字数:3721

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文