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

Support returning non-const references in random_entry_opt #31759

Merged
merged 2 commits into from
Jun 23, 2019

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

Want to get a non-const reference out when providing a non-const container.

Describe the solution

Make it so.

Take advantage of C++14 trailing return types to make this easier to write.

Describe alternatives you've considered

Could try to do something similar for other random_entry functions, but this was the simplest to fix.

Additional context

Came across the need for this on another branch I'm working on.

Want to get a non-const pointer out when providing a non-const
container.

Take advantage of C++14 trailing return types to make this easier to
write.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Jun 23, 2019
@ZhilkinSerg ZhilkinSerg merged commit fa508ce into CleverRaven:master Jun 23, 2019
@jbytheway jbytheway deleted the non_const_random_entry branch June 23, 2019 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants