diff options
author | Tom Tromey <tom@tromey.com> | 2023-10-15 13:40:03 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-11-29 14:29:44 -0700 |
commit | d02f31bb130fd54fa2891cbc28fbc01f603eca6c (patch) | |
tree | 21c2064691afbe2dfa6fca037c23c462e14d57cc /gdbsupport | |
parent | cc87f13181d12a7844e1988fe2d27ead4150d263 (diff) | |
download | gdb-d02f31bb130fd54fa2891cbc28fbc01f603eca6c.zip gdb-d02f31bb130fd54fa2891cbc28fbc01f603eca6c.tar.gz gdb-d02f31bb130fd54fa2891cbc28fbc01f603eca6c.tar.bz2 |
Use C++17 void_t
C++17 has void_t and make_void, so gdbsupport/traits.h can be
simplified.
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/traits.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/gdbsupport/traits.h b/gdbsupport/traits.h index f6bb649..277e117 100644 --- a/gdbsupport/traits.h +++ b/gdbsupport/traits.h @@ -43,15 +43,6 @@ namespace gdb { -/* Pre C++14-safe (CWG 1558) version of C++17's std::void_t. See - <http://en.cppreference.com/w/cpp/types/void_t>. */ - -template<typename... Ts> -struct make_void { typedef void type; }; - -template<typename... Ts> -using void_t = typename make_void<Ts...>::type; - /* Implementation of the detection idiom: - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf @@ -79,7 +70,7 @@ struct detector /* Implementation of the detection idiom (positive case). */ template<typename Default, template<typename...> class Op, typename... Args> -struct detector<Default, void_t<Op<Args...>>, Op, Args...> +struct detector<Default, std::void_t<Op<Args...>>, Op, Args...> { using value_t = std::true_type; using type = Op<Args...>; |