File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
include/boost/openmethod/policies Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,19 +42,23 @@ class vptr_map : public vptr {
4242 // ! @ref IdsToVptr objects.
4343 // ! @param first The beginning of the range.
4444 // ! @param last The end of the range.
45- template <class ForwardIterator >
45+ template <class ForwardIterator , class ... Options >
4646 static void initialize (ForwardIterator first, ForwardIterator last) {
47+ decltype (vptrs) new_vptrs;
48+
4749 for (auto iter = first; iter != last; ++iter) {
4850 for (auto type_iter = iter->type_id_begin ();
4951 type_iter != iter->type_id_end (); ++type_iter) {
5052
5153 if constexpr (Registry::has_indirect_vptr) {
52- vptrs .emplace (*type_iter, &iter->vptr ());
54+ new_vptrs .emplace (*type_iter, &iter->vptr ());
5355 } else {
54- vptrs .emplace (*type_iter, iter->vptr ());
56+ new_vptrs .emplace (*type_iter, iter->vptr ());
5557 }
5658 }
5759 }
60+
61+ vptrs.swap (new_vptrs);
5862 }
5963
6064 // ! Returns a reference to a v-table pointer for an object.
You can’t perform that action at this time.
0 commit comments