summaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-08 09:54:16 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-08 09:54:16 +0200
commit63ed5749ace68cce8662611aea85562959361e78 (patch)
tree24c9ce032345ff25dfca772f54209ea658fccafb /core/templates
parent4509404ed8c14abf482727b054f9a926ce154991 (diff)
parentdee65d14351a419cfeaac0e1e0da0a497bd445fb (diff)
downloadredot-engine-63ed5749ace68cce8662611aea85562959361e78.tar.gz
Merge pull request #91104 from RandomShaper/simple_type_cpp
Redefine `GetSimpleTypeT<>` in terms of `<type_traits>`
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/command_queue_mt.h2
-rw-r--r--core/templates/simple_type.h21
2 files changed, 3 insertions, 20 deletions
diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h
index c149861467..bb36f38d54 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