Я пытаюсь кодировать онлайн -класс Open Sourse с C ++. Я использую контейнер Unoromeded_set в LAB1. Однако каждый раз, когда я хочу «сделать». Это воспитывалось с следующей ошибкой; < /p>
Вот мой код; < /p>
Я создаю класс и хочу протолкнуть его в Unoromeded_set. < /P>
class Input_data {
private:
std::string _data;
uint64_t _index;
bool _eof;
public:
Input_data(const std::string &data, const uint64_t index, const bool eof) : _data(data), _index(index), _eof(eof) {}
bool operator_index < B._index) {
return true;
} else {
return false;
}
}
};
< /code>
class StreamReassembler {
private:
size_t _current_index = 0;
size_t _current_volume = 0;
ByteStream _output; //!< The reassembled in-order byte stream
size_t _capacity; //!< The maximum number of bytes
std::unordered_set _unsorted_data;
public:
StreamReassembler::StreamReassembler(const size_t capacity) : _output(capacity), _capacity(capacity), _unsorted_data() {}
...
}
< /code>
Here is the error:
In constructor ‘StreamReassembler::StreamReassembler(size_t)’:
/mnt/hgfs/AllShare/Cs144/libsponge/stream_reassembler.cc:15:103: error: use of deleted function ‘std::unordered_set::unordered_set() [with _Value = Input_data; _Hash = std::hash; _Pred = std::equal_to; _Alloc = std::allocator]’
15 | size_t capacity) : _output(capacity), _capacity(capacity), _unsorted_data() {}
| ^~~~~~~~~~~~~~~~
< /code>
my g++ and gcc version is 11
I'm a beginner of c++, I think it might be a simple question however I googled 2 days without finding a way to pass the error. Looking for some help.
Подробнее здесь: https://stackoverflow.com/questions/756 ... d-function
C ++ с контейнером Unoromeded_Set, не могу сделать с использованием удаленной функции ⇐ C++
Программы на C++. Форум разработчиков
1752131274
Anonymous
Я пытаюсь кодировать онлайн -класс Open Sourse с C ++. Я использую контейнер Unoromeded_set в LAB1. Однако каждый раз, когда я хочу «сделать». Это воспитывалось с следующей ошибкой; < /p>
Вот мой код; < /p>
Я создаю класс и хочу протолкнуть его в Unoromeded_set. < /P>
class Input_data {
private:
std::string _data;
uint64_t _index;
bool _eof;
public:
Input_data(const std::string &data, const uint64_t index, const bool eof) : _data(data), _index(index), _eof(eof) {}
bool operator_index < B._index) {
return true;
} else {
return false;
}
}
};
< /code>
class StreamReassembler {
private:
size_t _current_index = 0;
size_t _current_volume = 0;
ByteStream _output; //!< The reassembled in-order byte stream
size_t _capacity; //!< The maximum number of bytes
std::unordered_set _unsorted_data;
public:
StreamReassembler::StreamReassembler(const size_t capacity) : _output(capacity), _capacity(capacity), _unsorted_data() {}
...
}
< /code>
Here is the error:
In constructor ‘StreamReassembler::StreamReassembler(size_t)’:
/mnt/hgfs/AllShare/Cs144/libsponge/stream_reassembler.cc:15:103: error: use of deleted function ‘std::unordered_set::unordered_set() [with _Value = Input_data; _Hash = std::hash; _Pred = std::equal_to; _Alloc = std::allocator]’
15 | size_t capacity) : _output(capacity), _capacity(capacity), _unsorted_data() {}
| ^~~~~~~~~~~~~~~~
< /code>
my g++ and gcc version is 11
I'm a beginner of c++, I think it might be a simple question however I googled 2 days without finding a way to pass the error. Looking for some help.
Подробнее здесь: [url]https://stackoverflow.com/questions/75670604/c-with-unordered-set-container-cant-make-with-use-of-deleted-function[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия