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

Is this a bug in irange.hpp #87

Open
PatrickMGrace opened this issue Mar 15, 2019 · 1 comment
Open

Is this a bug in irange.hpp #87

PatrickMGrace opened this issue Mar 15, 2019 · 1 comment

Comments

@PatrickMGrace
Copy link

Lines 166 to 169 in irange.hpp:
166 reference dereference() const
167 {
168 return m_first + (m_step * m_step_size);
169 }
This looks like it is returning a reference to a temporary. Undefined behaviour?

@PatrickMGrace
Copy link
Author

On closer inspection it seems to be OK as reference and value_type are both defined the same, i.e. Integer. However, it would be clearer if "reference" was replaced with "value_type" as the return type of the function.

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