From 7d083fd08cb5fbf1e5e953adf72c2c38c258c888 Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 7 Sep 2016 22:16:10 +0100 Subject: [PATCH] Issue #329, fixed build issues on clang Fixed build issues that clang shows up the MS VS accepts. --- gsl/gsl_byte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gsl/gsl_byte b/gsl/gsl_byte index c973320..f502ab0 100644 --- a/gsl/gsl_byte +++ b/gsl/gsl_byte @@ -106,14 +106,15 @@ constexpr IntegerType to_integer(byte b) noexcept return {b}; } -template +template 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() version." - ) + ); + return static_cast(t); } template<> constexpr byte to_byte_impl(unsigned char t) noexcept