2

クラストランザクションのベクトルがあり、次のコードを使用して特定の範囲の要素を削除しようとしています。コンパイル時にエラーが発生します:
「エラー: 削除された関数 'std::atomic_bool& std::atomic_bool::operator=(const std::atomic_bool&) の使用」 アトミック ブール メンバーを持つクラスを削除する正しい方法は何ですか?

void Transactions::forget(size_t up_to)
{
   size_t deletion_limit = up_to - forgotten_;
   transactions_.erase(transactions_.begin(),transactions_.begin()+deletion_limit)
   forgotten_ += up_to; 
}

ここで、トランザクションは私のクラス Transaction のベクトルです

class Transaction {
public:
    Transaction(std::vector<Insert> &&insert_ops, std::vector<Remove> &&remove_ops);
    void process_inserts();
    void process_removes(Database &database);
    bool inserts_processed();
    bool removes_processed();
    Affected get_affected_inserts(Relation relation);
    Affected get_affected_deletes(Relation relation);
private:
    // Clear after being processed
    std::vector<Insert> *insert_ops_;
    std::vector<Remove> *remove_ops_;
    std::atomic_bool inserts_done_, removes_done_;
    std::map<Relation, Affected> inserted_tuples_, removed_tuples_;
};
4

0 に答える 0