import Libnest2D msvc build fix

This commit is contained in:
tamasmeszaros 2019-01-23 14:07:54 +01:00
parent 9c25c62e3e
commit 22ffb93ee5
3 changed files with 5 additions and 8 deletions

View file

@ -647,8 +647,7 @@ public:
* This method makes possible to "preload" some items into the placer. It * This method makes possible to "preload" some items into the placer. It
* will not move these items but will consider them as already packed. * will not move these items but will consider them as already packed.
*/ */
template<class Range = ConstItemRange<DefaultIterator>> inline void preload(const ItemGroup& packeditems)
inline void preload(const Range& packeditems = Range())
{ {
impl_.preload(packeditems); impl_.preload(packeditems);
} }

View file

@ -60,8 +60,7 @@ public:
} }
template<class Range = ConstItemRange<DefaultIter>> template<class Range = ConstItemRange<DefaultIter>>
bool pack(Item& item, bool pack(Item& item, const Range& rem = Range()) {
const Range& rem = Range()) {
auto&& r = static_cast<Subclass*>(this)->trypack(item, rem); auto&& r = static_cast<Subclass*>(this)->trypack(item, rem);
if(r) { if(r) {
items_.push_back(*(r.item_ptr_)); items_.push_back(*(r.item_ptr_));
@ -70,9 +69,8 @@ public:
return r; return r;
} }
template<class Range = ConstItemRange<DefaultIter>> void preload(const ItemGroup& packeditems) {
void preload(const Range& packeditems = Range()) { items_.insert(items_.end(), packeditems.begin(), packeditems.end());
items_.insert(items_.end(), packeditems.from, packeditems.to);
farea_valid_ = false; farea_valid_ = false;
} }

View file

@ -46,7 +46,7 @@ public:
for(ItemGroup& ig : packed_bins_) { for(ItemGroup& ig : packed_bins_) {
placers.emplace_back(bin); placers.emplace_back(bin);
placers.back().configure(pconfig); placers.back().configure(pconfig);
placers.back().preload({ig.begin(), ig.end()}); placers.back().preload(ig);
} }
std::copy(first, last, std::back_inserter(store_)); std::copy(first, last, std::back_inserter(store_));