У меня есть такой блок кода:
namespace bi = boost::intrusive;
struct Container {
struct Item {
bi::set_member_hook<> link;
int x;
};
struct Cmp {
bool opeartor()(Item const& it1, Item const &it2) const {
return it1.x < it2.x;
}
};
using Set = typename bi::set<Item,
bi::member_hook<Item, bi::set_member_hook<>, &Item::link>,
bi::compare<Cmp>,
bi::constant_time_size<false>
>;
Container(Container const& o) {
auto cloner = [](const Item &x) {
return current_allocator().construct<Item>(x);
};
with_allocator(_alloctor, [&] {
new (&_data) Set;
_data.clone_from(o._data, cloner, current_deleter<Item>());
}
}
private:
Set _data;
};
Программа иногда завершается с этим сообщением:
завершить вызов без активного исключения
Я нашел ответ от stackoverflow, который из-за throw
был вызван без активного исключения. Но если без активного исключения он не сможет достичь блока catch
.
Извините за мой плохой английский
РЕДАКТИРОВАТЬ: пример кода был обновлен.
РЕДАКТИРОВАТЬ 2: Исправьте код, как @: рекомендуется RemyLebeau, и ошибка все еще происходит.