Skip to content

Commit

Permalink
Fix GCC8 warnings 'useless cast to type'. (microsoft#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoullet authored and Anna Gringauze committed Jun 15, 2018
1 parent ffdaf0f commit a9ef39f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/gsl/multi_span
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public:
}

constexpr static_bounds(std::initializer_list<size_type> il)
: m_ranges(static_cast<const std::ptrdiff_t*>(il.begin()))
: m_ranges(il.begin())
{
// Size of the initializer list must match the rank of the array
Expects((MyRanges::DynamicNum == 0 && il.size() == 1 && *il.begin() == static_size) ||
Expand Down Expand Up @@ -1686,7 +1686,7 @@ constexpr auto as_multi_span(multi_span<byte, Dimensions...> s) GSL_NOEXCEPT
static_assert(
std::is_trivial<std::decay_t<U>>::value &&
(ByteSpan::bounds_type::static_size == dynamic_range ||
ByteSpan::bounds_type::static_size % static_cast<std::size_t>(sizeof(U)) == 0),
ByteSpan::bounds_type::static_size % sizeof(U) == 0),
"Target type must be a trivial type and its size must match the byte array size");

Expects((s.size_bytes() % sizeof(U)) == 0);
Expand Down

0 comments on commit a9ef39f

Please sign in to comment.