File tree Expand file tree Collapse file tree 5 files changed +34
-8
lines changed Expand file tree Collapse file tree 5 files changed +34
-8
lines changed Original file line number Diff line number Diff line change 112017-09-20 Jonathan Wakely <
[email protected] >
22
3+ * include/bits/c++config (_GLIBCXX17_DEPRECATED): Define.
4+ * include/bits/functional_hash.h (__hash_base::result_type)
5+ (__hash_base::argument_type): Add _GLIBCXX17_DEPRECATED.
6+ * include/std/optional (hash<optional<T>>::result_type)
7+ (hash<optional<T>>::argument_type): Add deprecated attribute.
8+ (__is_fast_hash<hash<optional<T>>>): Add partial specialization.
9+ * include/std/variant (hash<variant<Types...>>::result_type)
10+ (hash<variant<Types...>>::argument_type): Add deprecated attribute.
11+ (__is_fast_hash<hash<variant<Types...>>>): Add partial specialization.
12+
313 * libsupc++/exception_ptr.h (copy_exception): Remove deprecated
414 non-standard function.
515
Original file line number Diff line number Diff line change 7777// Macros for deprecated attributes.
7878// _GLIBCXX_USE_DEPRECATED
7979// _GLIBCXX_DEPRECATED
80+ // _GLIBCXX17_DEPRECATED
8081#ifndef _GLIBCXX_USE_DEPRECATED
8182# define _GLIBCXX_USE_DEPRECATED 1
8283#endif
8788# define _GLIBCXX_DEPRECATED
8889#endif
8990
91+ #if defined(__DEPRECATED) && (__cplusplus >= 201703L)
92+ # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
93+ #else
94+ # define _GLIBCXX17_DEPRECATED
95+ #endif
96+
9097// Macros for ABI tag attributes.
9198#ifndef _GLIBCXX_ABI_TAG_CXX11
9299# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ (" cxx11" )))
Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
4949 template <typename _Result, typename _Arg>
5050 struct __hash_base
5151 {
52- typedef _Result result_type;
53- typedef _Arg argument_type;
52+ typedef _Result result_type _GLIBCXX17_DEPRECATED ;
53+ typedef _Arg argument_type _GLIBCXX17_DEPRECATED ;
5454 };
5555
5656 // / Primary class template hash.
Original file line number Diff line number Diff line change @@ -1028,10 +1028,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
10281028 : private __poison_hash<remove_const_t <_Tp>>,
10291029 public __optional_hash_call_base<_Tp>
10301030 {
1031- using result_type = size_t ;
1032- using argument_type = optional<_Tp>;
1031+ using result_type [[__deprecated__]] = size_t ;
1032+ using argument_type [[__deprecated__]] = optional<_Tp>;
10331033 };
10341034
1035+ template <typename _Tp>
1036+ struct __is_fast_hash <hash<optional<_Tp>>> : __is_fast_hash<hash<_Tp>>
1037+ { };
1038+
10351039 // / @}
10361040
10371041 template <typename _Tp> optional (_Tp) -> optional<_Tp>;
Original file line number Diff line number Diff line change @@ -1420,15 +1420,15 @@ namespace __variant
14201420 variant<_Types...>, std::index_sequence_for<_Types...>>,
14211421 public __variant_hash_call_base<_Types...>
14221422 {
1423- using result_type = size_t ;
1424- using argument_type = variant<_Types...>;
1423+ using result_type [[__deprecated__]] = size_t ;
1424+ using argument_type [[__deprecated__]] = variant<_Types...>;
14251425 };
14261426
14271427 template <>
14281428 struct hash <monostate>
14291429 {
1430- using result_type = size_t ;
1431- using argument_type = monostate;
1430+ using result_type [[__deprecated__]] = size_t ;
1431+ using argument_type [[__deprecated__]] = monostate;
14321432
14331433 size_t
14341434 operator ()(const monostate& __t ) const noexcept
@@ -1438,6 +1438,11 @@ namespace __variant
14381438 }
14391439 };
14401440
1441+ template <typename ... _Types>
1442+ struct __is_fast_hash <hash<variant<_Types...>>>
1443+ : bool_constant<(__is_fast_hash<_Types>::value && ...)>
1444+ { };
1445+
14411446_GLIBCXX_END_NAMESPACE_VERSION
14421447} // namespace std
14431448
You can’t perform that action at this time.
0 commit comments