From a0e432bf6814a1fae8e41c02e5f97ae6642385a1 Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Mon, 5 Mar 2018 15:05:06 +0300 Subject: Using _t suffix instead of ::type in whole project + using std:: somewhere. --- routing/coding.hpp | 12 +++++------- routing/route_weight.cpp | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'routing') diff --git a/routing/coding.hpp b/routing/coding.hpp index 7136333675..804f4f3048 100644 --- a/routing/coding.hpp +++ b/routing/coding.hpp @@ -72,7 +72,7 @@ void WriteGamma(BitWriter & writer, T value) // ModularCast makes unambiguous conversion from unsigned value to signed. // The resulting value is the least signed integer congruent to the source integer // (modulo 2^n where n is the number of bits used to represent the unsigned type) -template ::type> +template > Signed ModularCast(Unsigned value) { static_assert(std::is_unsigned::value, "T should be an unsigned type"); @@ -85,16 +85,15 @@ Signed ModularCast(Unsigned value) } // Encodes current as delta compared with prev. -template ::type> +template > UnsignedT EncodeZigZagDelta(T prev, T current) { static_assert(std::is_integral::value, "T should be an integral type"); - using SignedT = typename std::make_signed::type; auto const unsignedPrev = static_cast(prev); auto const unsignedCurrent = static_cast(current); auto originalDelta = ModularCast(static_cast(unsignedCurrent - unsignedPrev)); - static_assert(std::is_same::value, + static_assert(std::is_same>::value, "It's expected that ModuleCast returns SignedT"); auto encodedDelta = bits::ZigZagEncode(originalDelta); @@ -104,14 +103,13 @@ UnsignedT EncodeZigZagDelta(T prev, T current) } // Reverse function for EncodeZigZagDelta. -template ::type> +template > T DecodeZigZagDelta(T prev, UnsignedT delta) { static_assert(std::is_integral::value, "T should be an integral type"); - using SignedT = typename std::make_signed::type; auto decoded = bits::ZigZagDecode(delta); - static_assert(std::is_same::value, + static_assert(std::is_same>::value, "It's expected that bits::ZigZagDecode returns SignedT"); return prev + static_cast(decoded); } diff --git a/routing/route_weight.cpp b/routing/route_weight.cpp index f4ade713ab..0e6e50f2c2 100644 --- a/routing/route_weight.cpp +++ b/routing/route_weight.cpp @@ -8,8 +8,7 @@ using namespace std; namespace { -template ::value, void>::type> +template ::value, void>> bool SumWillOverflow(Number lhs, Number rhs) { if (lhs > 0) -- cgit v1.2.3