mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-20 20:49:50 +01:00
scripted-diff: modernize outdated trait patterns - types
The use of e.g. `std::underlying_type_t<T>` replaces the older `typename std::underlying_type<T>::type`. The `_t` helper alias template (such as `std::underlying_type_t<T>`) introduced in C++14 offers a cleaner and more concise way to extract the type directly. See https://en.cppreference.com/w/cpp/types/underlying_type for details. -BEGIN VERIFY SCRIPT- sed -i -E 's/(typename )?(std::[a-z_]+)(<[^<>]+>)::type\b/\2_t\3/g' $(git grep -l '::type' ./src ':(exclude)src/bench/nanobench.h' ':(exclude)src/leveldb' ':(exclude)src/minisketch' ':(exclude)src/span.h' ':(exclude)src/sync.h') -END VERIFY SCRIPT-
This commit is contained in:
@@ -24,7 +24,7 @@ static_assert(!ValidDeployment(static_cast<Consensus::BuriedDeployment>(Consensu
|
||||
template<typename T, T x>
|
||||
static constexpr bool is_minimum()
|
||||
{
|
||||
using U = typename std::underlying_type<T>::type;
|
||||
using U = std::underlying_type_t<T>;
|
||||
return x == std::numeric_limits<U>::min();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user