Don't collect invalid bounding boxes (ref #3709)

This commit is contained in:
Artem Pavlenko 2017-11-07 14:32:33 +01:00
parent 0a15a955a2
commit a408b0732e

View file

@ -61,10 +61,13 @@ struct push_box_impl
template <typename T0, typename T1, typename T2, typename T3> template <typename T0, typename T1, typename T2, typename T3>
void operator() (T0 & boxes, T1 const& begin, T2 const& box, T3 const& range) const void operator() (T0 & boxes, T1 const& begin, T2 const& box, T3 const& range) const
{ {
boxes.emplace_back(box, if (box.valid())
std::make_pair(std::distance(begin, {
range.begin()), boxes.emplace_back(box,
std::distance(range.begin(), range.end()))); std::make_pair(std::distance(begin,
range.begin()),
std::distance(range.begin(), range.end())));
}
} }
}; };