diff --git a/src/deploymentstatus.cpp b/src/deploymentstatus.cpp index 71f27024304..46fd70bc26a 100644 --- a/src/deploymentstatus.cpp +++ b/src/deploymentstatus.cpp @@ -24,7 +24,7 @@ static_assert(!ValidDeployment(static_cast(Consensu template static constexpr bool is_minimum() { - using U = typename std::underlying_type::type; + using U = std::underlying_type_t; return x == std::numeric_limits::min(); } diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index df1ced48a71..87f8c35a14c 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -45,7 +45,7 @@ enum class AddressPurpose; enum isminetype : unsigned int; struct CRecipient; struct WalletContext; -using isminefilter = std::underlying_type::type; +using isminefilter = std::underlying_type_t; } // namespace wallet namespace interfaces { diff --git a/src/net_permissions.h b/src/net_permissions.h index 33babd62046..c93e18e160c 100644 --- a/src/net_permissions.h +++ b/src/net_permissions.h @@ -48,7 +48,7 @@ enum class NetPermissionFlags : uint32_t { }; static inline constexpr NetPermissionFlags operator|(NetPermissionFlags a, NetPermissionFlags b) { - using t = typename std::underlying_type::type; + using t = std::underlying_type_t; return static_cast(static_cast(a) | static_cast(b)); } @@ -59,7 +59,7 @@ public: static std::vector ToStrings(NetPermissionFlags flags); static inline bool HasFlag(NetPermissionFlags flags, NetPermissionFlags f) { - using t = typename std::underlying_type::type; + using t = std::underlying_type_t; return (static_cast(flags) & static_cast(f)) == static_cast(f); } static inline void AddFlag(NetPermissionFlags& flags, NetPermissionFlags f) @@ -74,7 +74,7 @@ public: static inline void ClearFlag(NetPermissionFlags& flags, NetPermissionFlags f) { assert(f == NetPermissionFlags::Implicit); - using t = typename std::underlying_type::type; + using t = std::underlying_type_t; flags = static_cast(static_cast(flags) & ~static_cast(f)); } }; diff --git a/src/netbase.h b/src/netbase.h index bf4d7ececc6..d7c6e1c215c 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -37,12 +37,12 @@ enum class ConnectionDirection { Both = (In | Out), }; static inline ConnectionDirection& operator|=(ConnectionDirection& a, ConnectionDirection b) { - using underlying = typename std::underlying_type::type; + using underlying = std::underlying_type_t; a = ConnectionDirection(underlying(a) | underlying(b)); return a; } static inline bool operator&(ConnectionDirection a, ConnectionDirection b) { - using underlying = typename std::underlying_type::type; + using underlying = std::underlying_type_t; return (underlying(a) & underlying(b)); } diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 7a46a5109bc..903caef22ce 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -70,10 +70,10 @@ namespace { */ template CSHA512& operator<<(CSHA512& hasher, const T& data) { - static_assert(!std::is_same::type, char*>::value, "Calling operator<<(CSHA512, char*) is probably not what you want"); - static_assert(!std::is_same::type, unsigned char*>::value, "Calling operator<<(CSHA512, unsigned char*) is probably not what you want"); - static_assert(!std::is_same::type, const char*>::value, "Calling operator<<(CSHA512, const char*) is probably not what you want"); - static_assert(!std::is_same::type, const unsigned char*>::value, "Calling operator<<(CSHA512, const unsigned char*) is probably not what you want"); + static_assert(!std::is_same, char*>::value, "Calling operator<<(CSHA512, char*) is probably not what you want"); + static_assert(!std::is_same, unsigned char*>::value, "Calling operator<<(CSHA512, unsigned char*) is probably not what you want"); + static_assert(!std::is_same, const char*>::value, "Calling operator<<(CSHA512, const char*) is probably not what you want"); + static_assert(!std::is_same, const unsigned char*>::value, "Calling operator<<(CSHA512, const unsigned char*) is probably not what you want"); hasher.Write((const unsigned char*)&data, sizeof(data)); return hasher; } diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 2941dda8c0a..4c83517c8da 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -49,7 +49,7 @@ const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hu std::string GetAllOutputTypes() { std::vector ret; - using U = std::underlying_type::type; + using U = std::underlying_type_t; for (U i = (U)TxoutType::NONSTANDARD; i <= (U)TxoutType::WITNESS_UNKNOWN; ++i) { ret.emplace_back(GetTxnOutputType(static_cast(i))); } diff --git a/src/serialize.h b/src/serialize.h index 6384c95dba3..ea6b1907700 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -154,7 +154,7 @@ const Out& AsBase(const In& x) } #define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__)) -#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, typename std::remove_const::type& obj) { code; }) +#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, std::remove_const_t& obj) { code; }) #define SER_WRITE(obj, code) ser_action.SerWrite(s, obj, [&](Stream& s, const Type& obj) { code; }) /** @@ -507,12 +507,12 @@ struct VarIntFormatter { template void Ser(Stream &s, I v) { - WriteVarInt::type>(s, v); + WriteVarInt>(s, v); } template void Unser(Stream& s, I& v) { - v = ReadVarInt::type>(s); + v = ReadVarInt>(s); } }; diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index 38be59fb64b..ae301621fbd 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -134,7 +134,7 @@ template { return fuzzed_data_provider.ConsumeBool() ? fuzzed_data_provider.PickValueInArray(all_types) : - WeakEnumType(fuzzed_data_provider.ConsumeIntegral::type>()); + WeakEnumType(fuzzed_data_provider.ConsumeIntegral>()); } [[nodiscard]] inline opcodetype ConsumeOpcodeType(FuzzedDataProvider& fuzzed_data_provider) noexcept diff --git a/src/util/vector.h b/src/util/vector.h index 1513562f1be..0c5645ebedf 100644 --- a/src/util/vector.h +++ b/src/util/vector.h @@ -20,9 +20,9 @@ * (list initialization always copies). */ template -inline std::vector::type> Vector(Args&&... args) +inline std::vector> Vector(Args&&... args) { - std::vector::type> ret; + std::vector> ret; ret.reserve(sizeof...(args)); // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html (void)std::initializer_list{(ret.emplace_back(std::forward(args)), 0)...}; diff --git a/src/wallet/types.h b/src/wallet/types.h index 7e3b2caeb19..66eac17d45b 100644 --- a/src/wallet/types.h +++ b/src/wallet/types.h @@ -48,7 +48,7 @@ enum isminetype : unsigned int { ISMINE_ENUM_ELEMENTS, }; /** used for bitflags of isminetype */ -using isminefilter = std::underlying_type::type; +using isminefilter = std::underlying_type_t; /** * Address purpose field that has been been stored with wallet sending and