diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-09-23 23:16:30 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-09-24 15:18:11 +0100 |
commit | 2b667beba693e876322af7c6682f9bc885c5ec28 (patch) | |
tree | 9e72c426022758ff0c98a38fda2a510b647d3d62 /libstdc++-v3/testsuite/17_intro | |
parent | ad2aab5c816a6fd56b46210c0a4a4c6243da1de9 (diff) | |
download | gcc-2b667beba693e876322af7c6682f9bc885c5ec28.zip gcc-2b667beba693e876322af7c6682f9bc885c5ec28.tar.gz gcc-2b667beba693e876322af7c6682f9bc885c5ec28.tar.bz2 |
libstdc++: Simplify detection idiom using concepts
Add a simpler definition of std::__detected_or using concepts. This
also replaces the __detector::value_t member which should have been using
a reserved name.
Use __detected_or in pointer_traits.
libstdc++-v3/ChangeLog:
* include/bits/alloc_traits.h (allocator_traits::is_always_equal):
Only instantiate is_empty if needed.
* include/bits/ptr_traits.h (__ptr_traits_impl::difference_type)
(__ptr_traits_impl::rebind): Use __detected_or.
* include/experimental/type_traits (is_same_v): Add a partial
specialization instead of instantiating the std::is_same class
template.
(detected_t): Redefine in terms of detected_or_t.
(is_detected, is_detected_v): Redefine in terms of detected_t.
* include/std/type_traits [__cpp_concepts] (__detected_or): Add
new definition using concepts.
(__detector::value_t): Rename to __is_detected.
* testsuite/17_intro/names.cc: Check value_t isn't used.
Diffstat (limited to 'libstdc++-v3/testsuite/17_intro')
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/names.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index 82e201c..6490cd6 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -112,6 +112,7 @@ #define tmp ( #define sz ( #define token ( +#define value_t ( #if __cplusplus < 201103L #define uses_allocator ( |