[all-commits] [llvm/llvm-project] b2d25e: [libc++] Implement shared_ptr methods inline in th...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Oct 26 10:11:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2d25ef2d1e50bf012fdb18ef721917292d67bcf
      https://github.com/llvm/llvm-project/commit/b2d25ef2d1e50bf012fdb18ef721917292d67bcf
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-10-26 (Tue, 26 Oct 2021)

  Changed paths:
    M libcxx/include/__memory/shared_ptr.h

  Log Message:
  -----------
  [libc++] Implement shared_ptr methods inline in the class

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.

Differential Revision: https://reviews.llvm.org/D112478




More information about the All-commits mailing list