mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
More fixes.
This commit is contained in:
@@ -99,13 +99,13 @@ bool fitsPrecisionBaseX(bigint const& _mantissa, double _log2OfBase, uint32_t _e
|
||||
/// @a Out will typically be either std::string or bytes.
|
||||
/// @a T will typically by unsigned, u160, u256 or bigint.
|
||||
template <class T, class Out>
|
||||
inline void toBigEndian(T _val, Out& o_out)
|
||||
inline void toBigEndian(T _val, Out&& o_out)
|
||||
{
|
||||
static_assert(std::is_same<bigint, T>::value || !std::numeric_limits<T>::is_signed, "only unsigned types or bigint supported"); //bigint does not carry sign bit on shift
|
||||
for (auto i = o_out.size(); i != 0; _val >>= 8, i--)
|
||||
{
|
||||
T v = _val & (T)0xff;
|
||||
o_out[i - 1] = (typename Out::value_type)(uint8_t)v;
|
||||
o_out[i - 1] = (typename std::remove_reference_t<Out>::value_type)(uint8_t)v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user