Move lambda expression outside of assert to prevent "unevaluated" error
Fixes #705
This commit is contained in:
parent
cd53790993
commit
7da045060b
12
src/json.hpp
12
src/json.hpp
@ -1495,13 +1495,15 @@ class input_adapter
|
|||||||
{
|
{
|
||||||
// assertion to check that the iterator range is indeed contiguous,
|
// assertion to check that the iterator range is indeed contiguous,
|
||||||
// see http://stackoverflow.com/a/35008842/266378 for more discussion
|
// 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(
|
assert(std::accumulate(
|
||||||
first, last, std::pair<bool, int>(true, 0),
|
first, last, std::pair<bool, int>(true, 0),
|
||||||
[&first](std::pair<bool, int> res, decltype(*first) val)
|
lf_is_contiguous).first);
|
||||||
{
|
|
||||||
res.first &= (val == *(std::next(std::addressof(*first), res.second++)));
|
|
||||||
return res;
|
|
||||||
}).first);
|
|
||||||
|
|
||||||
// assertion to check that each element is 1 byte long
|
// assertion to check that each element is 1 byte long
|
||||||
static_assert(
|
static_assert(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user