mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fix static_asserts to better match error string. Updated tests accordingly.
This commit is contained in:
parent
8ae77b1fd5
commit
044255f363
@ -75,7 +75,7 @@ namespace details
|
|||||||
class coordinate_facade
|
class coordinate_facade
|
||||||
{
|
{
|
||||||
static_assert(std::is_integral<ValueType>::value
|
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!");
|
static_assert(Rank > 0, "Rank must be greater than 0!");
|
||||||
|
|
||||||
template <typename OtherConcreteType, typename OtherValueType, unsigned int OtherRank>
|
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... >;
|
using MyRanges = details::BoundsRanges <SizeType, FirstRange, RestRanges... >;
|
||||||
static_assert(std::is_integral<SizeType>::value
|
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;
|
MyRanges m_ranges;
|
||||||
_CONSTEXPR static_bounds(const MyRanges & range) : m_ranges(range) { }
|
_CONSTEXPR static_bounds(const MyRanges & range) : m_ranges(range) { }
|
||||||
|
@ -1305,7 +1305,7 @@ SUITE(array_view_tests)
|
|||||||
TEST(custmized_array_view_size)
|
TEST(custmized_array_view_size)
|
||||||
{
|
{
|
||||||
double (*arr)[3][4] = new double[100][3][4];
|
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
|
struct EffectiveStructure
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user