MS

Size: a a a
MS

r
error: passing ‘const TemporaryQueueWriter’ as ‘this’ argument discards qualifiers [-fpermissive]Как- то так
82 | while (obj.state())
AP
AP
r
AP
struct A {
void foo() const {}
};A
AP
AP
r
class TemporaryQueueWriter: public BasicThread {
public:
void SetTestimonySource(std::function<void(TemporaryQueueWriter &)> testimony_queue_writer){
_testimony_queue_writer = testimony_queue_writer;
}
void StartThread();
void Stop();
bool state(){
return running;
}
void change_state(bool r){
running = r;
}
protected:
void Run() override;
void OnWaitForStop() override;
private:
std::atomic<bool> running;
std::function<void(TemporaryQueueWriter &)> _testimony_queue_writer;
};
С таким методом void TemporaryQueueWriter::Run() {
_testimony_queue_writer();
}
Приводит к такой ошибкеerror: no match for call to ‘(std::function<void(TemporaryQueueWriter&)>) ()’В методе Run()
G
_testimony_queue_writer(*this);?r
r
А
А

VD
VD
А
G
size >= index + 1
Ну або додавай елемент, якщо index == 0 і size == 0А