Issue #329, fixed build issues on clang

Fixed build issues that clang shows up the MS VS accepts.
This commit is contained in:
Kris 2016-09-07 22:16:10 +01:00
parent 55b232dde4
commit 7d083fd08c

View File

@ -106,14 +106,15 @@ constexpr IntegerType to_integer(byte b) noexcept
return {b};
}
template<bool, typename T>
template<bool E, typename T>
constexpr byte to_byte_impl(T t) noexcept
{
static_assert(
false,
E,
"gsl::to_byte(t) must be provided an unsigned char, otherwise data loss may occur. "
"If you are calling to_byte with an integer contant use: gsl::to_byte<t>() version."
)
);
return static_cast<byte>(t);
}
template<>
constexpr byte to_byte_impl<true, unsigned char>(unsigned char t) noexcept