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 [] getData #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add [] getData #7

wants to merge 1 commit into from

Conversation

3038922
Copy link

@3038922 3038922 commented Nov 8, 2020

add [] getData

add [] getData
{
if (i >= N)
{
throw std::out_of_range("Array index error");
Copy link
Owner

@JustasMasiulis JustasMasiulis Nov 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for not replying to your issue and thanks for the additions 👍

However, could you change the exception message to circular_buffer::at index out of range to reflect the source of exception better?

Edit: now that I'm thinking about it, it should check whether index is within bounds of valid elements, not just allocation, so that would need to be fixed too

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

Successfully merging this pull request may close these issues.

2 participants