diff options
author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2023-11-27 00:07:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 00:07:39 +0100 |
commit | ef1b3c2ea0f3f44845f0db3419780584cb1aa545 (patch) | |
tree | 0c38d68dd2de4f434304179cd5e830a0bcd4cc28 /src/common | |
parent | abf85fb44f66344064bc12b20228652c26b33395 (diff) |
chore(Core/Misc): Clean up workarounds (#17870)
* Clean advstd to use std c++20 features
* Use ABORT instead of std::abort
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Utilities/EventProcessor.h | 3 | ||||
-rw-r--r-- | src/common/Utilities/Types.h | 4 | ||||
-rw-r--r-- | src/common/Utilities/advstd.h | 16 |
3 files changed, 2 insertions, 21 deletions
diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h index 40ff62a494..0ebd48077b 100644 --- a/src/common/Utilities/EventProcessor.h +++ b/src/common/Utilities/EventProcessor.h @@ -21,7 +21,6 @@ #include "Define.h" #include "Duration.h" #include "Random.h" -#include "advstd.h" #include <map> #include <type_traits> @@ -90,7 +89,7 @@ class LambdaBasicEvent : public BasicEvent }; template<typename T> -using is_lambda_event = std::enable_if_t<!std::is_base_of_v<BasicEvent, std::remove_pointer_t<advstd::remove_cvref_t<T>>>>; +using is_lambda_event = std::enable_if_t<!std::is_base_of_v<BasicEvent, std::remove_pointer_t<std::remove_cvref_t<T>>>>; typedef std::multimap<uint64, BasicEvent*> EventList; diff --git a/src/common/Utilities/Types.h b/src/common/Utilities/Types.h index 0fb8112553..ad7b2c4983 100644 --- a/src/common/Utilities/Types.h +++ b/src/common/Utilities/Types.h @@ -18,8 +18,6 @@ #ifndef _TYPES_H_ #define _TYPES_H_ -#include "advstd.h" - namespace Acore { // end "iterator" tag for find_type_if @@ -35,7 +33,7 @@ namespace Acore }; template<template<typename...> typename Check, typename T1, typename... Ts> - struct find_type_if<Check, T1, Ts...> : std::conditional_t<Check<T1>::value, advstd::type_identity<T1>, find_type_if<Check, Ts...>> + struct find_type_if<Check, T1, Ts...> : std::conditional_t<Check<T1>::value, std::type_identity<T1>, find_type_if<Check, Ts...>> { }; diff --git a/src/common/Utilities/advstd.h b/src/common/Utilities/advstd.h index 09485ff4b7..eafe58e4cd 100644 --- a/src/common/Utilities/advstd.h +++ b/src/common/Utilities/advstd.h @@ -24,22 +24,6 @@ // this namespace holds implementations of upcoming stdlib features that our c++ version doesn't have yet namespace advstd { - // This workaround for std::remove_cvref_t, std::type_identify is needed for GCC 8... - /// @todo: remove when we drop GCC 8 support. https://en.cppreference.com/w/cpp/compiler_support/20 - // C++20 advstd::remove_cvref_t - template <class T> - using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>; - - // C++20 std::type_identity - template <typename T> - struct type_identity - { - using type = T; - }; - - // C++20 std::type_identity_t - template <typename T> - using type_identity_t = typename type_identity<T>::type; } #endif // _ADV_STD_H_ |