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
А