[libcxx-commits] [PATCH] D119335: [libc++][NFC] Reformat and modernize compressed_pair.h

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 9 12:43:08 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/__memory/compressed_pair.h:68
+  template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value>>
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit
+  __compressed_pair_elem(_Up&& __u) : __value_type(std::forward<_Up>(__u)) {}
----------------
Quuxplusone wrote:
> ldionne wrote:
> > Suggestion: move the `explicit` to the next line, otherwise it's really easy to miss.
> +1, `explicit` should come on the same line (and immediately preceding) the ctor's name.
> I'd like to see `explicit` added to the ctors on new lines 63, 64, 65, and 74 as well, or know the reason why that would break things. Implicit conversions are the devil, and we shouldn't //need// any non-explicit ctors anywhere on the implementation side of things. (As opposed to on the public-API side, like `std::pair` and `std::vector` and so on, where the Standard mandates many ctors to be non-explicit.)
I want this to stay NFC, so I won't add `explicit` here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119335/new/

https://reviews.llvm.org/D119335



More information about the libcxx-commits mailing list