Use C++17 variable templates for type traits

The C++17 variable templates are slightly more readable and allow us to
remove the typename keyword in a few cases.

closes https://github.com/official-stockfish/Stockfish/pull/4806

No functional change
This commit is contained in:
Sebastian Buchwald
2023-09-25 12:24:48 +02:00
committed by Disservin
parent 31d0b7fe93
commit 4f0fecad8a
4 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ namespace Stockfish::Eval::NNUE {
else
{
std::uint8_t u[sizeof(IntType)];
typename std::make_unsigned<IntType>::type v = 0;
std::make_unsigned_t<IntType> v = 0;
stream.read(reinterpret_cast<char*>(u), sizeof(IntType));
for (std::size_t i = 0; i < sizeof(IntType); ++i)
@@ -128,7 +128,7 @@ namespace Stockfish::Eval::NNUE {
else
{
std::uint8_t u[sizeof(IntType)];
typename std::make_unsigned<IntType>::type v = value;
std::make_unsigned_t<IntType> v = value;
std::size_t i = 0;
// if constexpr to silence the warning about shift by 8