jnk0le / Ring-Buffer

simple C++11 ring buffer implementation, allocated and evaluated at compile time
MIT License
380 stars 64 forks source link

peek() is not right #8

Closed luxl closed 5 years ago

luxl commented 5 years ago

shouldn't it be return &data_buff[tmp_tail & buffer_mask]; instead of return &data_buff[tmp_tail];, because head and tail keep growing, which may exceed the array boundary.