Skip to content

add [] getData#7

Open
3038922 wants to merge 1 commit into
JustasMasiulis:masterfrom
3038922:master
Open

add [] getData#7
3038922 wants to merge 1 commit into
JustasMasiulis:masterfrom
3038922:master

Conversation

@3038922

@3038922 3038922 commented Nov 8, 2020

Copy link
Copy Markdown

add [] getData

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

@JustasMasiulis JustasMasiulis Nov 8, 2020

Copy link
Copy Markdown
Owner

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