static_assert(
std::is_same<typename std::iterator_traits<Iterator>::iterator_category,
typename std::random_access_iterator_tag>::value,
- "The provided iterator should be a random access iterator.");
+ "The provided iterator needs to be a random access iterator.");
Assert(begin <= end,
ExcMessage(
- "The beginning of the array view should be before the end."));
+ "The beginning of the array view needs to be before the end."));
Assert(internal::ArrayViewHelper::is_contiguous(begin, end),
ExcMessage("The provided range isn't contiguous in memory!"));
// the reference type, not the value type, knows the constness of the iterator
{
Assert(begin <= end,
ExcMessage(
- "The beginning of the array view should be before the end."));
+ "The beginning of the array view needs to be before the end."));
return ArrayView<ElementType, MemorySpaceType>(begin, end - begin);
}
const std::array<double, 10> &v2 = v;
const auto a = make_array_view(v2.begin(), v2.end());
static_assert(is_const_reference<decltype(*a.begin())>(),
- "type should be const");
+ "type needs to be const");
static_assert(is_const_reference<decltype(*a.end())>(),
- "type should be const");
+ "type needs to be const");
v[5] = 10;
AssertThrow(a[5] == 10, ExcInternalError());
std::vector<double> v(10);
std::fill(v.begin(), v.end(), 42.0);
auto a = make_array_view(v.cbegin() + 2, v.cend());
- // a should be ArrayView<const double>
+ // a needs to be ArrayView<const double>
static_assert(!std::is_const<decltype(a)>::value,
"a should not be const (but has const value)");
static_assert(std::is_const<decltype(a)::value_type>::value,
- "a::value_type should be const");
+ "a::value_type needs to be const");
static_assert(is_const_reference<decltype(*a.begin())>(),
- "type should be const");
+ "type needs to be const");
static_assert(is_const_reference<decltype(*a.end())>(),
- "type should be const");
+ "type needs to be const");
v[2] = 10.0;
AssertThrow(a[0] == v[2], ExcInternalError());
}
// static_vector::cbegin() and static_vector::cend() correctly, so ignore
// the type checking in that case
#if BOOST_VERSION >= 106200
- // a should be const ArrayView<const double>
+ // a needs to be const ArrayView<const double>
static_assert(std::is_const<decltype(a)>::value,
"a should not be const (but has const value)");
static_assert(std::is_const<decltype(a)::value_type>::value,
- "a::value_type should be const");
+ "a::value_type needs to be const");
static_assert(is_const_reference<decltype(*a.begin())>(),
- "type should be const");
+ "type needs to be const");
static_assert(is_const_reference<decltype(*a.end())>(),
- "type should be const");
+ "type needs to be const");
#endif
v[2] = 10.0;
AssertThrow(a[0] == v[2], ExcInternalError());
// to make CTest happy
#ifndef DEBUG
deallog
- << "ExcMessage(\"The beginning of the array view should be before the end.\")"
+ << "ExcMessage(\"The beginning of the array view needs to be before the end.\")"
<< std::endl;
deallog
- << "ExcMessage(\"The beginning of the array view should be before the end.\")"
+ << "ExcMessage(\"The beginning of the array view needs to be before the end.\")"
<< std::endl;
#endif
}