diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -545,15 +545,13 @@ #if _LIBCPP_STD_VER > 11 template _LIBCPP_INLINE_VISIBILITY - typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type - operator () ( const _K2& __x, const _CP& __y ) const - {return static_cast(*this) (__x, __y.__get_value().first);} + bool operator()(const _K2& __x, const _CP& __y) const + {return static_cast(*this)(__x, __y.__get_value().first);} template _LIBCPP_INLINE_VISIBILITY - typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type - operator () (const _CP& __x, const _K2& __y) const - {return static_cast(*this) (__x.__get_value().first, __y);} + bool operator()(const _CP& __x, const _K2& __y) const + {return static_cast(*this)(__x.__get_value().first, __y);} #endif }; @@ -593,15 +591,13 @@ #if _LIBCPP_STD_VER > 11 template _LIBCPP_INLINE_VISIBILITY - typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type - operator () ( const _K2& __x, const _CP& __y ) const - {return comp (__x, __y.__get_value().first);} + bool operator()(const _K2& __x, const _CP& __y) const + {return comp(__x, __y.__get_value().first);} template _LIBCPP_INLINE_VISIBILITY - typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type - operator () (const _CP& __x, const _K2& __y) const - {return comp (__x.__get_value().first, __y);} + bool operator()(const _CP& __x, const _K2& __y) const + {return comp(__x.__get_value().first, __y);} #endif }; diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -473,11 +473,12 @@ size_t operator()(const _Key& __x) const {return static_cast(*this)(__x);} #if _LIBCPP_STD_VER > 17 - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY size_t operator()(const _K2& __x) const {return static_cast(*this)(__x);} #endif + _LIBCPP_INLINE_VISIBILITY void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value) { @@ -508,11 +509,12 @@ size_t operator()(const _Key& __x) const {return __hash_(__x);} #if _LIBCPP_STD_VER > 17 - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY size_t operator()(const _K2& __x) const {return __hash_(__x);} #endif + _LIBCPP_INLINE_VISIBILITY void swap(__unordered_map_hasher& __y) _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value) { @@ -557,23 +559,24 @@ bool operator()(const _Key& __x, const _Cp& __y) const {return static_cast(*this)(__x, __y.__get_value().first);} #if _LIBCPP_STD_VER > 17 - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _K2& __y) const {return static_cast(*this)(__x.__get_value().first, __y);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _K2& __x, const _Cp& __y) const {return static_cast(*this)(__x, __y.__get_value().first);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _K2& __y) const {return static_cast(*this)(__x, __y);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _K2& __x, const _Key& __y) const {return static_cast(*this)(__x, __y);} #endif + _LIBCPP_INLINE_VISIBILITY void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { @@ -607,23 +610,24 @@ bool operator()(const _Key& __x, const _Cp& __y) const {return __pred_(__x, __y.__get_value().first);} #if _LIBCPP_STD_VER > 17 - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _K2& __y) const {return __pred_(__x.__get_value().first, __y);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _K2& __x, const _Cp& __y) const {return __pred_(__x, __y.__get_value().first);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _K2& __y) const {return __pred_(__x, __y);} - template ::value && __is_transparent<_Pred, _K2>::value>> + template _LIBCPP_INLINE_VISIBILITY bool operator()(const _K2& __x, const _Key& __y) const {return __pred_(__x, __y);} #endif + _LIBCPP_INLINE_VISIBILITY void swap(__unordered_map_equal& __y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { @@ -1355,51 +1359,48 @@ iterator find(const key_type& __k) {return __table_.find(__k);} _LIBCPP_INLINE_VISIBILITY const_iterator find(const key_type& __k) const {return __table_.find(__k);} - - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, iterator> - find(const _K2& __k) {return __table_.find(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, const_iterator> - find(const _K2& __k) const {return __table_.find(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + iterator find(const _K2& __k) {return __table_.find(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + const_iterator find(const _K2& __k) const {return __table_.find(__k);} +#endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, size_type> - count(const _K2& __k) const {return __table_.__count_unique(__k);} - #endif // _LIBCPP_STD_VER > 17 - #if _LIBCPP_STD_VER > 17 - _LIBCPP_INLINE_VISIBILITY - bool contains(const key_type& __k) const {return find(__k) != end();} +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + size_type count(const _K2& __k) const {return __table_.__count_unique(__k);} +#endif // _LIBCPP_STD_VER > 17 + +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY + bool contains(const key_type& __k) const {return find(__k) != end();} + + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + bool contains(const _K2& __k) const {return find(__k) != end();} +#endif // _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, bool> - contains(const _K2& __k) const {return find(__k) != end();} - #endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) {return __table_.__equal_range_unique(__k);} _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) const {return __table_.__equal_range_unique(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) + {return __table_.__equal_range_unique(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) const + {return __table_.__equal_range_unique(__k);} +#endif // _LIBCPP_STD_VER > 17 mapped_type& operator[](const key_type& __k); #ifndef _LIBCPP_CXX03_LANG @@ -2167,49 +2168,48 @@ iterator find(const key_type& __k) {return __table_.find(__k);} _LIBCPP_INLINE_VISIBILITY const_iterator find(const key_type& __k) const {return __table_.find(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, iterator> - find(const _K2& __k) {return __table_.find(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, const_iterator> - find(const _K2& __k) const {return __table_.find(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + iterator find(const _K2& __k) {return __table_.find(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + const_iterator find(const _K2& __k) const {return __table_.find(__k);} +#endif // _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, size_type> - count(const _K2& __k) const {return __table_.__count_multi(__k);} - #endif // _LIBCPP_STD_VER > 17 - #if _LIBCPP_STD_VER > 17 - _LIBCPP_INLINE_VISIBILITY - bool contains(const key_type& __k) const {return find(__k) != end();} +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + size_type count(const _K2& __k) const {return __table_.__count_multi(__k);} +#endif // _LIBCPP_STD_VER > 17 + +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY + bool contains(const key_type& __k) const {return find(__k) != end();} + + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + bool contains(const _K2& __k) const {return find(__k) != end();} +#endif // _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, bool> - contains(const _K2& __k) const {return find(__k) != end();} - #endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) {return __table_.__equal_range_multi(__k);} _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) const {return __table_.__equal_range_multi(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) + {return __table_.__equal_range_multi(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) const + {return __table_.__equal_range_multi(__k);} +#endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -706,49 +706,48 @@ iterator find(const key_type& __k) {return __table_.find(__k);} _LIBCPP_INLINE_VISIBILITY const_iterator find(const key_type& __k) const {return __table_.find(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, iterator> - find(const _K2& __k) {return __table_.find(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, const_iterator> - find(const _K2& __k) const {return __table_.find(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + iterator find(const _K2& __k) {return __table_.find(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + const_iterator find(const _K2& __k) const {return __table_.find(__k);} +#endif // _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, size_type> - count(const _K2& __k) const {return __table_.__count_unique(__k);} - #endif // _LIBCPP_STD_VER > 17 - #if _LIBCPP_STD_VER > 17 - _LIBCPP_INLINE_VISIBILITY - bool contains(const key_type& __k) const {return find(__k) != end();} +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + size_type count(const _K2& __k) const {return __table_.__count_unique(__k);} +#endif // _LIBCPP_STD_VER > 17 + +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY + bool contains(const key_type& __k) const {return find(__k) != end();} + + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + bool contains(const _K2& __k) const {return find(__k) != end();} +#endif // _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, bool> - contains(const _K2& __k) const {return find(__k) != end();} - #endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) {return __table_.__equal_range_unique(__k);} _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) const {return __table_.__equal_range_unique(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) + {return __table_.__equal_range_unique(__k);} + template ::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) const + {return __table_.__equal_range_unique(__k);} +#endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} @@ -1372,49 +1371,48 @@ iterator find(const key_type& __k) {return __table_.find(__k);} _LIBCPP_INLINE_VISIBILITY const_iterator find(const key_type& __k) const {return __table_.find(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, iterator> - find(const _K2& __k) {return __table_.find(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, const_iterator> - find(const _K2& __k) const {return __table_.find(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + iterator find(const _K2& __k) {return __table_.find(__k);} + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + const_iterator find(const _K2& __k) const {return __table_.find(__k);} +#endif // _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, size_type> - count(const _K2& __k) const {return __table_.__count_multi(__k);} - #endif // _LIBCPP_STD_VER > 17 - #if _LIBCPP_STD_VER > 17 - _LIBCPP_INLINE_VISIBILITY - bool contains(const key_type& __k) const {return find(__k) != end();} +#if _LIBCPP_STD_VER > 17 + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + size_type count(const _K2& __k) const {return __table_.__count_multi(__k);} +#endif // _LIBCPP_STD_VER > 17 + +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY + bool contains(const key_type& __k) const {return find(__k) != end();} + + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + bool contains(const _K2& __k) const {return find(__k) != end();} +#endif // _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, bool> - contains(const _K2& __k) const {return find(__k) != end();} - #endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) {return __table_.__equal_range_multi(__k);} _LIBCPP_INLINE_VISIBILITY pair equal_range(const key_type& __k) const {return __table_.__equal_range_multi(__k);} - #if _LIBCPP_STD_VER > 17 - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);} - template - _LIBCPP_INLINE_VISIBILITY - enable_if_t<__is_transparent::value && __is_transparent::value, pair> - equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);} - #endif // _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) + {return __table_.__equal_range_multi(__k);} + template::value && __is_transparent::value>* = nullptr> + _LIBCPP_INLINE_VISIBILITY + pair equal_range(const _K2& __k) const + {return __table_.__equal_range_multi(__k);} +#endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} diff --git a/libcxx/test/std/containers/unord/unord.map/contains.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/contains.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.map/contains.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/contains.transparent.pass.cpp @@ -23,39 +23,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_contains(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_transparent_contains({{1, 2}, {2, 3}}); + test_transparent_contains({{1, 2}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = const unord_map_type; - test_transparent_contains(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type; + test_transparent_contains({{1, 2}, {2, 3}}); + test_transparent_contains({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_contains(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = const unord_map_type >; - test_non_transparent_contains(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = const unord_map_type >; - test_non_transparent_contains(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.map/count.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/count.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.map/count.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/count.transparent.pass.cpp @@ -24,39 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_count(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_transparent_count({{1, 2}, {2, 3}}); + test_transparent_count({{1, 2}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = - const unord_map_type; - test_transparent_count(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type; + test_transparent_count({{1, 2}, {2, 3}}); + test_transparent_count({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {2, 3}}); + test_non_transparent_count({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = - const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {2, 3}}); + test_non_transparent_count({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = - const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {2, 3}}); + test_non_transparent_count({{1, 2}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/equal_range.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.map/equal_range_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.map/equal_range.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/equal_range.transparent.pass.cpp @@ -24,41 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = unord_map_type >; - test_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_transparent_equal_range({{1, 2}, {2, 3}}); + test_transparent_equal_range({{1, 2}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = unord_map_type; - test_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type; + test_transparent_equal_range({{1, 2}, {2, 3}}); + test_transparent_equal_range({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.map/equal_range_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/equal_range_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.map/equal_range_const.transparent.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// template -// pair equal_range(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - using ilist_type = std::initializer_list >; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = const unord_map_type; - test_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {2, 3}}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.map/find_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/find.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.map/find_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.map/find.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.map/find_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/find.transparent.pass.cpp @@ -24,41 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = unord_map_type >; - test_transparent_find(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_transparent_find({{1, 2}, {2, 3}}); + test_transparent_find({{1, 2}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = unord_map_type; - test_transparent_find(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type; + test_transparent_find({{1, 2}, {2, 3}}); + test_transparent_find({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {2, 3}}); + test_non_transparent_find({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {2, 3}}); + test_non_transparent_find({{1, 2}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {2, 3}}); + test_non_transparent_find({{1, 2}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.map/find_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.map/find_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.map/find_const.transparent.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// template -// const_iterator find(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - using ilist_type = std::initializer_list >; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_find(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = const unord_map_type; - test_transparent_find(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {2, 3}}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.multimap/contains.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/contains.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/contains.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/contains.transparent.pass.cpp @@ -23,42 +23,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = unord_map_type >; - test_transparent_contains(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = unord_map_type; - test_transparent_contains(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type; + test_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = unord_map_type >; - test_non_transparent_contains(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = unord_map_type >; - test_non_transparent_contains( - ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = unord_map_type >; - test_non_transparent_contains( - ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_contains({{1, 2}, {1, 3}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multimap/count.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/count.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/count.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/count.transparent.pass.cpp @@ -24,39 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_count(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_transparent_count({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_count({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = - const unord_map_type; - test_transparent_count(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type; + test_transparent_count({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_count({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = - const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = - const unord_map_type >; - test_non_transparent_count(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_count({{1, 2}, {1, 3}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/equal_range.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.multimap/equal_range.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/equal_range.transparent.pass.cpp @@ -24,41 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = unord_map_type >; - test_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = unord_map_type; - test_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type; + test_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_equal_range({{1, 2}, {1, 3}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.transparent.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multimap - -// template -// pair equal_range(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - using ilist_type = std::initializer_list >; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = const unord_map_type; - test_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = const unord_map_type >; - test_non_transparent_equal_range(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.multimap/find_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/find.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.multimap/find_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.multimap/find.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/find_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/find.transparent.pass.cpp @@ -24,41 +24,40 @@ int main(int, char**) { using key_type = StoredType; - using ilist_type = std::initializer_list >; { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = unord_map_type >; - test_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_transparent_find({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_find({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = unord_map_type; - test_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type; + test_transparent_find({{1, 2}, {1, 3}, {2, 3}}); + test_transparent_find({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent hasher - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for non-transparent key_equal - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); + using M = unord_map_type>; + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); + test_non_transparent_find({{1, 2}, {1, 3}, {2, 3}}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multimap/find_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/find_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.multimap/find_const.transparent.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multimap - -// template -// const_iterator find(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - using ilist_type = std::initializer_list >; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using map_type = const unord_map_type >; - test_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using map_type = const unord_map_type; - test_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using map_type = const unord_map_type >; - test_non_transparent_find(ilist_type{{1, 2}, {1, 3}, {2, 3}}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.multiset/contains.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/contains.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multiset/contains.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/contains.transparent.pass.cpp @@ -26,38 +26,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = unord_set_type >; - test_transparent_contains(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_contains({1, 1, 2}); + test_transparent_contains({1, 1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = unord_set_type; - test_transparent_contains(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_contains({1, 1, 2}); + test_transparent_contains({1, 1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = unord_set_type >; - test_non_transparent_contains(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_contains({1, 1, 2}); + test_non_transparent_contains({1, 1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = unord_set_type >; - test_non_transparent_contains( - key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_contains({1, 1, 2}); + test_non_transparent_contains({1, 1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = unord_set_type >; - test_non_transparent_contains( - key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_contains({1, 1, 2}); + test_non_transparent_contains({1, 1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multiset/count.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/count.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multiset/count.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/count.transparent.pass.cpp @@ -27,35 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_count(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_count({1, 1, 2}); + test_transparent_count({1, 1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = - const unord_set_type; - test_transparent_count(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_count({1, 1, 2}); + test_transparent_count({1, 1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 1, 2}); + test_non_transparent_count({1, 1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = - const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 1, 2}); + test_non_transparent_count({1, 1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = - const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 1, 2}); + test_non_transparent_count({1, 1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.set/equal_range_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/equal_range.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.set/equal_range_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.multiset/equal_range.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/equal_range_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/equal_range.transparent.pass.cpp @@ -10,7 +10,7 @@ // template , class Pred = equal_to, // class Alloc = allocator>> -// class unordered_set +// class unordered_multiset // template // pair equal_range(const K& k) const; @@ -27,37 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_equal_range({1, 1, 2}); + test_transparent_equal_range({1, 1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = const unord_set_type; - test_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_equal_range({1, 1, 2}); + test_transparent_equal_range({1, 1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 1, 2}); + test_non_transparent_equal_range({1, 1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 1, 2}); + test_non_transparent_equal_range({1, 1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 1, 2}); + test_non_transparent_equal_range({1, 1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multiset/equal_range_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/equal_range_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/equal_range_const.transparent.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multiset - -// template -// pair equal_range(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = const unord_set_type; - test_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = const unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.multiset/equal_range_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/equal_range_non_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/equal_range_non_const.transparent.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multiset - -// template -// pair equal_range(const K& k); - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = unord_set_type >; - test_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = unord_set_type; - test_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{1}, key_type{2}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.multiset/find_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/find.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.multiset/find_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.multiset/find.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multiset/find_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/find.transparent.pass.cpp @@ -27,37 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = unord_set_type >; - test_transparent_find(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_find({1, 1, 2}); + test_transparent_find({1, 1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = unord_set_type; - test_transparent_find(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_find({1, 1, 2}); + test_transparent_find({1, 1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 1, 2}); + test_non_transparent_find({1, 1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 1, 2}); + test_non_transparent_find({1, 1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 1, 2}); + test_non_transparent_find({1, 1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.multiset/find_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/find_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/find_const.transparent.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multiset - -// template -// const_iterator find(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_find(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = const unord_set_type; - test_transparent_find(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{1}, key_type{2}); - } - - return 0; -} diff --git a/libcxx/test/std/containers/unord/unord.set/contains.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.set/contains.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/contains.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/contains.transparent.pass.cpp @@ -10,7 +10,7 @@ // template , class Pred = equal_to, // class Alloc = allocator> -// class unordered_multiset +// class unordered_set // template // bool contains(const K& x) const; @@ -26,35 +26,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_contains(key_type(1), key_type(2)); + using S = unord_set_type>; + test_transparent_contains({1, 2}); + test_transparent_contains({1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = const unord_set_type; - test_transparent_contains(key_type(1), key_type(2)); + using S = unord_set_type; + test_transparent_contains({1, 2}); + test_transparent_contains({1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_contains(key_type(1), key_type(2)); + using S = unord_set_type>; + test_non_transparent_contains({1, 2}); + test_non_transparent_contains({1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = const unord_set_type >; - test_non_transparent_contains(key_type(1), key_type(2)); + using S = unord_set_type>; + test_non_transparent_contains({1, 2}); + test_non_transparent_contains({1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = const unord_set_type >; - test_non_transparent_contains(key_type(1), key_type(2)); + using S = unord_set_type>; + test_non_transparent_contains({1, 2}); + test_non_transparent_contains({1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.set/count.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.set/count.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/count.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/count.transparent.pass.cpp @@ -27,35 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_count(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_count({1, 2}); + test_transparent_count({1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = - const unord_set_type; - test_transparent_count(key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_count({1, 2}); + test_transparent_count({1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 2}); + test_non_transparent_count({1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = - const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 2}); + test_non_transparent_count({1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = - const unord_set_type >; - test_non_transparent_count(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_count({1, 2}); + test_non_transparent_count({1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.set/equal_range_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.set/equal_range.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.set/equal_range_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.set/equal_range.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/equal_range_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/equal_range.transparent.pass.cpp @@ -27,37 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = unord_set_type >; - test_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_equal_range({1, 2}); + test_transparent_equal_range({1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = unord_set_type; - test_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_equal_range({1, 2}); + test_transparent_equal_range({1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 2}); + test_non_transparent_equal_range({1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 2}); + test_non_transparent_equal_range({1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = unord_set_type >; - test_non_transparent_equal_range(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_equal_range({1, 2}); + test_non_transparent_equal_range({1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.set/find_non_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.set/find.transparent.pass.cpp rename from libcxx/test/std/containers/unord/unord.set/find_non_const.transparent.pass.cpp rename to libcxx/test/std/containers/unord/unord.set/find.transparent.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/find_non_const.transparent.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/find.transparent.pass.cpp @@ -27,37 +27,37 @@ { // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = unord_set_type >; - test_transparent_find(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_transparent_find({1, 2}); + test_transparent_find({1, 2}); } { // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = unord_set_type; - test_transparent_find(key_type{1}, key_type{2}); + using S = unord_set_type; + test_transparent_find({1, 2}); + test_transparent_find({1, 2}); } { // Make sure conversions do happen for non-transparent hasher - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 2}); + test_non_transparent_find({1, 2}); } { // Make sure conversions do happen for non-transparent key_equal - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 2}); + test_non_transparent_find({1, 2}); } { // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); + using S = unord_set_type>; + test_non_transparent_find({1, 2}); + test_non_transparent_find({1, 2}); } return 0; diff --git a/libcxx/test/std/containers/unord/unord.set/find_const.transparent.pass.cpp b/libcxx/test/std/containers/unord/unord.set/find_const.transparent.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/containers/unord/unord.set/find_const.transparent.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_set - -// template -// const_iterator find(const K& k) const; - -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -#include - -#include "test_transparent_unordered.h" - -int main(int, char**) -{ - using key_type = StoredType; - - { - // Make sure conversions don't happen for transparent non-final hasher and key_equal - using set_type = const unord_set_type >; - test_transparent_find(key_type{1}, key_type{2}); - } - - { - // Make sure conversions don't happen for transparent final hasher and key_equal - using set_type = const unord_set_type; - test_transparent_find(key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent hasher - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for non-transparent key_equal - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); - } - - { - // Make sure conversions do happen for both non-transparent hasher and key_equal - using set_type = const unord_set_type >; - test_non_transparent_find(key_type{1}, key_type{2}); - } - - return 0; -} diff --git a/libcxx/test/support/is_transparent.h b/libcxx/test/support/is_transparent.h --- a/libcxx/test/support/is_transparent.h +++ b/libcxx/test/support/is_transparent.h @@ -83,85 +83,4 @@ #endif // TEST_STD_VER > 11 -#if TEST_STD_VER > 17 - -template -struct StoredType; - -template -struct SearchedType; - -struct hash_impl { - template - constexpr std::size_t operator()(SearchedType const& t) const { - return static_cast(t.get_value()); - } - - template - constexpr std::size_t operator()(StoredType const& t) const { - return static_cast(t.get_value()); - } -}; - -struct non_transparent_hash : hash_impl {}; - -struct transparent_hash : hash_impl { - using is_transparent = void; -}; - -struct transparent_hash_final final : transparent_hash {}; - -struct transparent_equal_final final : std::equal_to<> {}; - -template -struct SearchedType { - SearchedType(T value, int* counter) : value_(value), conversions_(counter) { } - - // Whenever a conversion is performed, increment the counter to keep track - // of conversions. - operator StoredType() const { - ++*conversions_; - return StoredType{value_}; - } - - int get_value() const { - return value_; - } - -private: - T value_; - int* conversions_; -}; - -template -struct StoredType { - StoredType() = default; - StoredType(T value) : value_(value) { } - - friend bool operator==(StoredType const& lhs, StoredType const& rhs) { - return lhs.value_ == rhs.value_; - } - - // If we're being passed a SearchedType object, avoid the conversion - // to T. This allows testing that the transparent operations are correctly - // forwarding the SearchedType all the way to this comparison by checking - // that we didn't have a conversion when we search for a SearchedType - // in a container full of StoredType. - friend bool operator==(StoredType const& lhs, SearchedType const& rhs) { - return lhs.value_ == rhs.get_value(); - } - friend bool operator==(SearchedType const& lhs, StoredType const& rhs) { - return lhs.get_value() == rhs.value_; - } - - int get_value() const { - return value_; - } - -private: - T value_; -}; - -#endif // TEST_STD_VER > 17 - #endif // TRANSPARENT_H diff --git a/libcxx/test/support/test_transparent_unordered.h b/libcxx/test/support/test_transparent_unordered.h --- a/libcxx/test/support/test_transparent_unordered.h +++ b/libcxx/test/support/test_transparent_unordered.h @@ -14,121 +14,172 @@ #include -// testing transparent unordered containers #if TEST_STD_VER > 17 -template