Untitled conversation
- User
namespace model::custom::v1::recording { struct EcgDataList { std::vector<std::shared_ptr<Ecg>> data; EcgDataList() noexcept = default; EcgDataList(EcgDataList&& other) noexcept; EcgDataList& operator=(EcgDataList&& other) noexcept; auto toJson() const->Json::Value; auto toFlatbuffers() const->std::string; }; }Error C2280 'model::custom::v1::recording::Ecg::Ecg(const model::custom::v1::recording::Ecg &)': attempting to reference a deleted function
- Assistant
The error message you're encountering, , indicates that the compiler has found a place in your code where it attempts to use the copy constructor of the class, but the copy constructor has been deleted or is inaccessible (perhaps marked as or not defined, assuming the move operations have been declared).
- User
#include <fmt/format.h> #include "Ecg.hpp" using model::custom::v1::recording::Ecg; Ecg::Ecg(Ecg&& other) noexcept : timestamp(other.timestamp), duration(other.duration), channels(std::move(other.channels)) { } Ecg& Ecg::operator=(Ecg&& other) noexcept { timestamp = other.timestamp; duration = other.duration; channels = std::move(other.channels); return *this; } Ecg::Channel::Channel(Ecg::Channel&& other) noexcept : id(other.id), data(std::move(other.data)) { } Ecg::Channel::Channel(std::uint32_t id, std::vector<std::int16_t>&& data) noexcept : id(id), data(std::move(data)) { } Ecg::Channel& Ecg::Channel::operator=(Ecg::Channel&& other) noexcept { id = other.id; data = std::move(other.data); return *this; } auto Ecg::toJson() const -> Json::Value { auto json = Json::Value{}; auto channel_list = Json::Value{}; json["timestamp"] = timestamp; json["duration"] = duration; for (const auto& channel : channels) { auto channel_json = Json::Value{}; auto data = Json::Value{}; channel_json["id"] = channel.id; for (auto i = 0; i < channel.data.size(); ++i) { data.append(channel.data[i]); } channel_json["data"] = std::move(data); channel_list.append(std::move(channel_json)); } json["channels"] = std::move(channel_list); return json; } auto Ecg::toFlatbuffers() const->std::string { flatbuffers::FlatBufferBuilder builder; auto channel_list = std::vector<flatbuffers::Offset<synescope::flatbuffer::ecg::channel>>{}; for (const auto& channel : channels) { auto data_flat_vector = builder.CreateVector(channel.data); auto flat_channel = synescope::flatbuffer::ecg::Createchannel(builder, data_flat_vector, channel.id); channel_list.push_back(flat_channel); } const auto bin = synescope::flatbuffer::ecg::CreateRootDirect(builder, &channel_list, duration, timestamp); builder.Finish(bin); const auto flatbuf = std::string(reinterpret_cast<char*>(builder.GetBufferPointer()), builder.GetSize()); return flatbuf; } - Assistant
- User
#ifndef MODEL_CUSTOM_RECORDING_ECG_HPP # define MODEL_CUSTOM_RECORDING_ECG_HPP # include <vector> # include <json/value.h> # include "model/flatbuffers/generated/Ecg_generated.h" namespace model::custom::v1::recording { struct Ecg { struct Channel { std::uint32_t id; std::vector<std::int16_t> data; Channel() noexcept = default; Channel(Channel&& other) noexcept; Channel(std::uint32_t id, std::vector<std::int16_t>&& data) noexcept; Channel& operator=(Channel&& other) noexcept; }; std::size_t timestamp; std::size_t duration; std::vector<Channel> channels; Ecg() noexcept = default; Ecg(Ecg&& other) noexcept; Ecg& operator=(Ecg&& other) noexcept; auto toJson() const ->Json::Value; auto toFlatbuffers() const->std::string; }; } #endif // !MODEL_CUSTOM_RECORDING_ECG_HPPHere is the ECG class header
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.