I get the following error at this line:
const short pcmSample = *reinterpret_cast<const short*>(*(buffer->index));
buffer is an object of class
Here I am trying to convert a byte array into shorts. The code throws this runtime error and terminates.
class accumlator : public boost::circular_buffer<char>
i have initialized the iterator to point to begin of buffer
index is a iterator to circular buffer.
boost::cb_details::iterator::operator*() const [with
Buff = boost::circular_buffer, Traits =
boost::cb_details::iterator::reference = char&]:
Assertion `m_it != 0' failed.
i have even tracked this to the file boost/circular_buffer/detail.hpp
the assert condition checks - if iterator is pointing to end.
if it is pointing to end then it throws the assert.
Thanks in advance.
It seems you didn't assign index to a value. The operator* is doing a runtime check to make sure it's pointing to valid (non-0) value.