Added inline to byte member functions to fix MSVC 2013 warnings

This commit is contained in:
Neil MacIntosh 2016-09-13 12:17:17 -07:00 committed by GitHub
commit e40729a561

View File

@ -26,7 +26,7 @@
// constexpr is not understood // constexpr is not understood
#pragma push_macro("constexpr") #pragma push_macro("constexpr")
#define constexpr /*constexpr*/ #define constexpr /*constexpr*/
// noexcept is not understood // noexcept is not understood
#pragma push_macro("noexcept") #pragma push_macro("noexcept")
@ -68,37 +68,37 @@ constexpr byte operator>>(byte b, IntegerType shift) noexcept
return byte(static_cast<unsigned char>(b) >> shift); return byte(static_cast<unsigned char>(b) >> shift);
} }
constexpr byte& operator|=(byte& l, byte r) noexcept inline constexpr byte& operator|=(byte& l, byte r) noexcept
{ {
return l = byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r)); return l = byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
} }
constexpr byte operator|(byte l, byte r) noexcept inline constexpr byte operator|(byte l, byte r) noexcept
{ {
return byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r)); return byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
} }
constexpr byte& operator&=(byte& l, byte r) noexcept inline constexpr byte& operator&=(byte& l, byte r) noexcept
{ {
return l = byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r)); return l = byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
} }
constexpr byte operator&(byte l, byte r) noexcept inline constexpr byte operator&(byte l, byte r) noexcept
{ {
return byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r)); return byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
} }
constexpr byte& operator^=(byte& l, byte r) noexcept inline constexpr byte& operator^=(byte& l, byte r) noexcept
{ {
return l = byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r)); return l = byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
} }
constexpr byte operator^(byte l, byte r) noexcept inline constexpr byte operator^(byte l, byte r) noexcept
{ {
return byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r)); return byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
} }
constexpr byte operator~(byte b) noexcept { return byte(~static_cast<unsigned char>(b)); } inline constexpr byte operator~(byte b) noexcept { return byte(~static_cast<unsigned char>(b)); }
template <class IntegerType, class = std::enable_if_t<std::is_integral<IntegerType>::value>> template <class IntegerType, class = std::enable_if_t<std::is_integral<IntegerType>::value>>
constexpr IntegerType to_integer(byte b) noexcept constexpr IntegerType to_integer(byte b) noexcept