This commit is contained in:
Chuck Atkins 2017-08-22 14:52:32 +00:00 committed by GitHub
commit 6733c16f30

View File

@ -1495,13 +1495,15 @@ class input_adapter
{
// assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion
auto lf_is_contiguous =
[&first](std::pair<bool, int> res, decltype(*first) val)
{
res.first &= (val == *(std::next(std::addressof(*first), res.second++)));
return res;
};
assert(std::accumulate(
first, last, std::pair<bool, int>(true, 0),
[&first](std::pair<bool, int> res, decltype(*first) val)
{
res.first &= (val == *(std::next(std::addressof(*first), res.second++)));
return res;
}).first);
lf_is_contiguous).first);
// assertion to check that each element is 1 byte long
static_assert(