Код: Выделить всё
std::vector coefficients_Код: Выделить всё
std::vector functions_Код: Выделить всё
std::vector coefficients_
Код: Выделить всё
struct Interaction {
Interaction() = default;
~Interaction() = default;
// Interaction(Interaction const& other) = default;
// auto operator=(Interaction const& other) -> Interaction& = default;
// Interaction(Interaction&& other) noexcept = default;
// auto operator=(Interaction&& other) noexcept -> Interaction& = default;
Interaction(Interaction&& other) noexcept
: coefficients_(std::move(other.coefficients_))
, functions_(std::move(other.functions_))
, terms_(std::move(other.terms_))
, hash_value_(other.hash_value_) {};
auto operator=(Interaction&& other) noexcept -> Interaction& {
if (this != &other) {
std::swap(coefficients_, other.coefficients_);
std::swap(functions_, other.functions_);
std::swap(terms_, other.terms_);
std::swap(hash_value_, other.hash_value_);
}
return *this;
}
...
Код: Выделить всё
item[i].interaction = creator(...);
Я получаю ошибка сегментации в деструкторе ~Interaction() = default;, что, как я подозреваю, связано с term_, но я не уверен, как решить эту проблему.
Подробнее здесь: https://stackoverflow.com/questions/792 ... -correctly
Мобильная версия