From d251ab647dd4f48603b37b7150627a39e9a30f45 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Jan 2023 22:38:21 +0100 Subject: Core/Misc: Migrate our c++20 advstd to standard features (cherry picked from commit 7830e5a7a1b93b0cd083baa3b70a0cfeb475f5f5) --- src/common/Utilities/EventProcessor.h | 3 +-- src/common/Utilities/Types.h | 4 ++-- src/common/Utilities/advstd.h | 17 ----------------- src/server/game/Chat/ChatCommands/ChatCommand.h | 3 +-- src/server/game/Chat/ChatCommands/ChatCommandTags.h | 3 +-- 5 files changed, 5 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h index 2bf68216569..5cb51086891 100644 --- a/src/common/Utilities/EventProcessor.h +++ b/src/common/Utilities/EventProcessor.h @@ -18,7 +18,6 @@ #ifndef __EVENTPROCESSOR_H #define __EVENTPROCESSOR_H -#include "advstd.h" #include "Define.h" #include "Duration.h" #include "Random.h" @@ -89,7 +88,7 @@ private: }; template -using is_lambda_event = std::enable_if_t>>>; +using is_lambda_event = std::enable_if_t>>>; class TC_COMMON_API EventProcessor { diff --git a/src/common/Utilities/Types.h b/src/common/Utilities/Types.h index 223a09c4ee3..922be079de0 100644 --- a/src/common/Utilities/Types.h +++ b/src/common/Utilities/Types.h @@ -18,7 +18,7 @@ #ifndef Types_h__ #define Types_h__ -#include "advstd.h" +#include namespace Trinity { @@ -35,7 +35,7 @@ namespace Trinity }; template typename Check, typename T1, typename... Ts> - struct find_type_if : std::conditional_t::value, advstd::type_identity, find_type_if> + struct find_type_if : std::conditional_t::value, std::type_identity, find_type_if> { }; diff --git a/src/common/Utilities/advstd.h b/src/common/Utilities/advstd.h index 2552f7d12bb..ff2717c9755 100644 --- a/src/common/Utilities/advstd.h +++ b/src/common/Utilities/advstd.h @@ -18,26 +18,9 @@ #ifndef TRINITY_ADVSTD_H #define TRINITY_ADVSTD_H -#include -#include - // this namespace holds implementations of upcoming stdlib features that our c++ version doesn't have yet namespace advstd { - // C++20 advstd::remove_cvref_t - template - using remove_cvref_t = std::remove_cv_t>; - - // C++20 std::type_identity - template - struct type_identity - { - using type = T; - }; - - // C++20 std::type_identity_t - template - using type_identity_t = typename type_identity::type; } #endif diff --git a/src/server/game/Chat/ChatCommands/ChatCommand.h b/src/server/game/Chat/ChatCommands/ChatCommand.h index 9520a7ce7dd..329eecfc567 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommand.h +++ b/src/server/game/Chat/ChatCommands/ChatCommand.h @@ -18,7 +18,6 @@ #ifndef TRINITY_CHATCOMMAND_H #define TRINITY_CHATCOMMAND_H -#include "advstd.h" #include "ChatCommandArgs.h" #include "ChatCommandTags.h" #include "Define.h" @@ -116,7 +115,7 @@ namespace Trinity::Impl::ChatCommands } template struct HandlerToTuple { static_assert(Trinity::dependant_false_v, "Invalid command handler signature"); }; - template struct HandlerToTuple { using type = std::tuple...>; }; + template struct HandlerToTuple { using type = std::tuple...>; }; template using TupleType = typename HandlerToTuple::type; struct CommandInvoker diff --git a/src/server/game/Chat/ChatCommands/ChatCommandTags.h b/src/server/game/Chat/ChatCommands/ChatCommandTags.h index 0e2b79421c4..b90c614e85d 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandTags.h +++ b/src/server/game/Chat/ChatCommands/ChatCommandTags.h @@ -18,7 +18,6 @@ #ifndef TRINITY_CHATCOMMANDTAGS_H #define TRINITY_CHATCOMMANDTAGS_H -#include "advstd.h" #include "ChatCommandHelpers.h" #include "Hyperlinks.h" #include "ObjectGuid.h" @@ -213,7 +212,7 @@ namespace Trinity::ChatCommands struct Hyperlink : Trinity::Impl::ChatCommands::ContainerTag { using value_type = typename linktag::value_type; - using storage_type = advstd::remove_cvref_t; + using storage_type = std::remove_cvref_t; operator value_type() const { return val; } value_type operator*() const { return val; } -- cgit v1.2.3