[libcxx-commits] [libcxx] [libc++] Introduce _LIBCPP_COMPRESSED_ELEMENT (PR #134253)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 7 08:12:45 PDT 2025
================
@@ -633,47 +633,9 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Key,
- class _CP,
- class _Compare,
- bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value>
-class __map_value_compare : private _Compare {
-public:
- _LIBCPP_HIDE_FROM_ABI __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
- : _Compare() {}
- _LIBCPP_HIDE_FROM_ABI __map_value_compare(_Compare __c) _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
- : _Compare(__c) {}
- _LIBCPP_HIDE_FROM_ABI const _Compare& key_comp() const _NOEXCEPT { return *this; }
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _CP& __y) const {
- return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y.__get_value().first);
- }
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _Key& __y) const {
- return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);
- }
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const {
- return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);
- }
- _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {
- using std::swap;
- swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
- }
-
-# if _LIBCPP_STD_VER >= 14
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _CP& __y) const {
- return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);
- }
-
- template <typename _K2>
- _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _K2& __y) const {
- return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);
- }
-# endif
-};
-
template <class _Key, class _CP, class _Compare>
-class __map_value_compare<_Key, _CP, _Compare, false> {
- _Compare __comp_;
+class __map_value_compare {
----------------
ldionne wrote:
I think you're missing includes for `compressed_pair.h`. Please check throughout.
https://github.com/llvm/llvm-project/pull/134253
More information about the libcxx-commits
mailing list