[libcxx-commits] [libcxx] [libc++] Use using declarations to pull in functions from the numeric_limits base class (PR #160661)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 1 08:34:39 PDT 2025
================
@@ -455,9 +455,9 @@ class numeric_limits : private __libcpp_numeric_limits<_Tp> {
public:
static inline _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min() _NOEXCEPT { return __base::min(); }
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); }
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT { return __base::lowest(); }
+ using __base::lowest;
----------------
ldionne wrote:
I'm not a huge fan of the change as-is, since we now have to go down into the implementation of base classes to figure out the exact API (attributes, etc.), whereas before the patch we can see that right away.
I might feel differently if we did that consistently for all the members of `numeric_limits`, then we'd still lose the ability to see everything at a glance, but at least we'd immediately understand that each base is supposed to provide the exact same API.
https://github.com/llvm/llvm-project/pull/160661
More information about the libcxx-commits
mailing list