mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 06:17:49 +00:00
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:
committed by
Disservin
parent
31d0b7fe93
commit
4f0fecad8a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user