[libcxx-commits] [PATCH] D112478: [libc++] Implement shared_ptr methods inline in the class

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 25 12:27:15 PDT 2021


ldionne created this revision.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This patch refactors the shared_ptr methods from being defined out-of-line
to being defined inline in the class, like what we do for all new code in
the library. The benefits of doing that are that code is not as scattered
around and is hence easier to understand, and it avoids a ton of duplication
due to SFINAE checks. Defining the method where it is declared also removes
the possibility for mismatched attributes.

As a fly-by change, this also:

- Adds a few _LIBCPP_HIDE_FROM_ABI attributes
- Uses __enable_if_t instead of enable_if as a function argument, to match the style that we use everywhere else.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112478

Files:
  libcxx/include/__memory/shared_ptr.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112478.382080.patch
Type: text/x-patch
Size: 35050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211025/2736de1b/attachment-0001.bin>


More information about the libcxx-commits mailing list