Fix ConstexprIterator requirements tests - No constexpr algorithms!

2019-06-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Fix ConstexprIterator requirements tests - No constexpr algorithms!
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	Replace copy with hand-rolled loop.
	* testsuite/23_containers/array/requirements/constexpr_iter.cc:
	Ditto.

From-SVN: r272159
This commit is contained in:
Edward Smith-Rowland 2019-06-11 16:29:35 +00:00 committed by Edward Smith-Rowland
parent 9adfa8e25f
commit d37c29f942
3 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2019-06-09 Edward Smith-Rowland <3dw4rd@verizon.net>
Fix ConstexprIterator requirements tests - No constexpr algorithms!
* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
Replace copy with hand-rolled loop.
* testsuite/23_containers/array/requirements/constexpr_iter.cc:
Ditto.
2019-06-08 Edward Smith-Rowland <3dw4rd@verizon.net>
Test for C++20 p0858 - ConstexprIterator requirements.

View File

@ -30,7 +30,11 @@ test()
static_assert('W' == *(hw.cbegin() + 7));
std::array<int, hw.size()> a2{{0,0,0,0,0,0,0,0,0,0,0,0,0}};
std::copy(hw.begin(), hw.end(), a2.begin());
auto hwi = hw.begin();
auto hwe = hw.end();
auto a2i = a2.begin();
while (hwi != hwe)
*a2i++ = *hwi++;
return *(hw.cbegin() + 3);
}

View File

@ -29,7 +29,11 @@ test()
static_assert(1 == *a1.cbegin());
std::array<int, 3> a2{{0, 0, 0}};
std::copy(a1.begin(), a1.end(), a2.begin());
auto a1i = a1.begin();
auto a1e = a1.end();
auto a2i = a2.begin();
while (a1i != a1e)
*a2i++ = *a1i++;
return n;
}