diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2024-04-24 11:41:58 +0200 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2024-04-24 11:43:13 +0200 |
commit | dee65d14351a419cfeaac0e1e0da0a497bd445fb (patch) | |
tree | 55d5c656a1043ee75bf25439adda6b8101ac3819 /core/templates | |
parent | 7abe0c6014022874378cb64a11b26b0f0f178324 (diff) | |
download | redot-engine-dee65d14351a419cfeaac0e1e0da0a497bd445fb.tar.gz |
Redefine GetSimpleTypeT<> in terms of <type_traits>
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/command_queue_mt.h | 2 | ||||
-rw-r--r-- | core/templates/simple_type.h | 21 |
2 files changed, 3 insertions, 20 deletions
diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h index a4ac338bed..0c86bdb762 100644 --- a/core/templates/command_queue_mt.h +++ b/core/templates/command_queue_mt.h @@ -208,7 +208,7 @@ #define ARG(N) p##N #define PARAM(N) P##N p##N #define TYPE_PARAM(N) typename P##N -#define PARAM_DECL(N) typename GetSimpleTypeT<P##N>::type_t p##N +#define PARAM_DECL(N) GetSimpleTypeT<P##N> p##N #define DECL_CMD(N) \ template <typename T, typename M COMMA(N) COMMA_SEP_LIST(TYPE_PARAM, N)> \ diff --git a/core/templates/simple_type.h b/core/templates/simple_type.h index b2ae0110e2..197115ddb9 100644 --- a/core/templates/simple_type.h +++ b/core/templates/simple_type.h @@ -31,26 +31,9 @@ #ifndef SIMPLE_TYPE_H #define SIMPLE_TYPE_H -/* Batch of specializations to obtain the actual simple type */ +#include <type_traits> template <typename T> -struct GetSimpleTypeT { - typedef T type_t; -}; - -template <typename T> -struct GetSimpleTypeT<T &> { - typedef T type_t; -}; - -template <typename T> -struct GetSimpleTypeT<T const> { - typedef T type_t; -}; - -template <typename T> -struct GetSimpleTypeT<T const &> { - typedef T type_t; -}; +using GetSimpleTypeT = typename std::remove_cv_t<std::remove_reference_t<T>>; #endif // SIMPLE_TYPE_H |