can't store noncopyable list in std::vector

std::list can have a throwing move constructor.
std::vector of such lists makes copies when growing its storage array,
it doesn't move them.
render_thunk_list is noncopyable (because render_thunk is noncopyable),
and so can't be stored in std::vector in some STL implementations.
This commit is contained in:
Mickey Rose 2017-01-03 21:43:14 +01:00
parent 0a5495e442
commit 63128fdba1

View file

@ -66,7 +66,7 @@ void render_group_symbolizer(group_symbolizer const& sym,
// keep track of which lists of render thunks correspond to // keep track of which lists of render thunks correspond to
// entries in the group_layout_manager. // entries in the group_layout_manager.
std::vector<render_thunk_list> layout_thunks; std::list<render_thunk_list> layout_thunks;
// layout manager to store and arrange bboxes of matched features // layout manager to store and arrange bboxes of matched features
group_layout_manager layout_manager(props->get_layout()); group_layout_manager layout_manager(props->get_layout());
@ -182,11 +182,13 @@ void render_group_symbolizer(group_symbolizer const& sym,
pixel_position_list const& positions = helper.get(); pixel_position_list const& positions = helper.get();
for (pixel_position const& pos : positions) for (pixel_position const& pos : positions)
{ {
for (size_t layout_i = 0; layout_i < layout_thunks.size(); ++layout_i) size_t layout_i = 0;
for (auto const& thunks : layout_thunks)
{ {
pixel_position const& offset = layout_manager.offset_at(layout_i); pixel_position const& offset = layout_manager.offset_at(layout_i);
pixel_position render_offset = pos + offset; pixel_position render_offset = pos + offset;
render_thunks.render_list(layout_thunks[layout_i], render_offset); render_thunks.render_list(thunks, render_offset);
++layout_i;
} }
} }
} }