diff --git a/libcxx/include/map b/libcxx/include/map index 3cca20511fd2..25b75af377b0 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -545,15 +545,13 @@ public: #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 @@ public: #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 index c53fb18910f4..a420c53f65fe 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -473,11 +473,12 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 index 0bac48a2422e..5856e4bc4010 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -706,49 +706,48 @@ public: 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 @@ public: 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 index 5d3b5cecfbdf..b8742cdb4b6c 100644 --- 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 index 07276c25fe7c..1ae5a94d256a 100644 --- 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 similarity index 53% 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 index 97db1dcecc1e..07b34f3110e3 100644 --- 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 index 9e76f72081ed..000000000000 --- 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 similarity index 53% 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 index b4233a8333d1..623b86f6ab53 100644 --- 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 index cc9324f28190..000000000000 --- 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 index 2f07bcd37fa0..9ebf4f2aa5df 100644 --- 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 index 7abf662982f6..b9755cfdeaaf 100644 --- 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 similarity index 51% 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 index a4c7730fd85f..85248e59d780 100644 --- 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 index 2444e9ca9dc4..000000000000 --- 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 similarity index 52% 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 index 676c82a3bab1..4a32248b13ad 100644 --- 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 index 3737866cf4e0..000000000000 --- 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 index 0256d71c4690..b14021c6b8c8 100644 --- 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 @@ int main(int, char**) { // 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 index a56a12a902c1..64f9eddbddae 100644 --- 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 @@ int main(int, char**) { // 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 similarity index 53% 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 index 0c3f18bb4382..741058d8d251 100644 --- 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 @@ int main(int, char**) { // 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 index 991ffcd30dee..000000000000 --- 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 index dc84dc6a50c8..000000000000 --- 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 similarity index 53% 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 index 3255c8c6ab4f..27abb1569e41 100644 --- 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 @@ int main(int, char**) { // 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 index c3a765462514..000000000000 --- 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 index 6adf6ab4313e..78908053aa2f 100644 --- 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 @@ int main(int, char**) { // 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 index 277308ea5323..32af0a54cc5b 100644 --- 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 @@ int main(int, char**) { // 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 similarity index 55% 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 index 452d15d7b0c9..9844d83cda46 100644 --- 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 @@ int main(int, char**) { // 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 similarity index 55% 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 index 7fa3508ae09e..7510dd3514e6 100644 --- 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 @@ int main(int, char**) { // 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 index 6256ef35f5a8..000000000000 --- 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 index 9cc69f04fc65..700c894a8b60 100644 --- a/libcxx/test/support/is_transparent.h +++ b/libcxx/test/support/is_transparent.h @@ -83,85 +83,4 @@ bool operator <(const C2Int& rhs, int lhs) { return rhs.get() < lhs; #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 index 7bcbc19c05a8..e2d02402d808 100644 --- 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