Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interface to move the first/last elements pointers #22

Open
reddwarf69 opened this issue Nov 26, 2018 · 0 comments
Open

Add interface to move the first/last elements pointers #22

reddwarf69 opened this issue Nov 26, 2018 · 0 comments

Comments

@reddwarf69
Copy link

reddwarf69 commented Nov 26, 2018

I would like to use circular_buffer with Asio. And I'm not the only one -> https://stackoverflow.com/questions/19859833/read-data-into-a-circular-buffer

I could do something like

beast::buffers_cat(
asio::buffer(array_one().first, array_one().second),
asio::buffer(array_two().first, array_two().second)
)

to inform asio's async_read() of where it can write the received data to.
async_read would tell me how many bytes it has actually written into the circular_buffer.... and here I hit the wall. I need an API in circular_buffer where I can tell it "advance the pointer X elements because, even if push_back has not been called, the data is there".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant