How to add an item to the buffer? I tried:

std::string str = "qwerty"; std::string str2 = "test"; //std::cout << str[0]; FIFOBuffer buf(str.c_str(),6); buf.write(str2.c_str(), 4); 

Documentation

  • one
    Specify in the question what exactly you want to do and what you get in the end. In short, create a minimal reproducible example . In its current form, the question is not complete and can be closed by voting by other participants. - 伪位蔚蠂慰位蠀蟿

1 answer 1

Judging by the documentation, it works

 BasicFIFOBuffer( const T * pBuffer, std::size_t size, bool notify = false ); 

those. a buffer of 6 characters is created and already filled. To add there something else without extension is extremely problematic ...

Check what the isFull() call returns. You can write if isWritable() returns true .

Increase buffer size - resize .

That's all - just a quick glance at the documentation ... So theoretically you might have some other errors, but for now, look at these.

  • FIFOBuffer is a typedef for BasicFIFOBuffer<char> , so with creation everything is fine. - 伪位蔚蠂慰位蠀蟿
  • I will willingly believe. The remark is removed. - Harry