Fix static_asserts to better match error string. Updated tests accordingly.

This commit is contained in:
Kern Handa 2015-09-25 00:59:22 -07:00
parent 8ae77b1fd5
commit 044255f363
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ namespace details
class coordinate_facade
{
static_assert(std::is_integral<ValueType>::value
&& sizeof(ValueType) <= sizeof(size_t), "ValueType must be unsigned integral type!");
&& std::is_unsigned<ValueType>::value, "ValueType must be unsigned integral type!");
static_assert(Rank > 0, "Rank must be greater than 0!");
template <typename OtherConcreteType, typename OtherValueType, unsigned int OtherRank>
@ -771,7 +771,7 @@ class static_bounds<SizeType, FirstRange, RestRanges...>
{
using MyRanges = details::BoundsRanges <SizeType, FirstRange, RestRanges... >;
static_assert(std::is_integral<SizeType>::value
&& details::SizeTypeTraits<SizeType>::max_value <= SIZE_MAX, "SizeType must be an integral type and its numeric limits must be smaller than SIZE_MAX");
&& details::SizeTypeTraits<SizeType>::max_value <= (std::numeric_limits<size_t>::max)(), "SizeType must be an integral type and its numeric limits must be smaller than max size_t.");
MyRanges m_ranges;
_CONSTEXPR static_bounds(const MyRanges & range) : m_ranges(range) { }

View File

@ -1305,7 +1305,7 @@ SUITE(array_view_tests)
TEST(custmized_array_view_size)
{
double (*arr)[3][4] = new double[100][3][4];
array_view<array_view_options<double, char>, dynamic_range, 3, 4> av1(arr, (char)10);
array_view<array_view_options<double, unsigned char>, dynamic_range, 3, 4> av1(arr, (char)10);
struct EffectiveStructure
{