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

Returning references with AsString method #31

Closed
Pepiloto opened this issue Feb 15, 2022 · 1 comment · Fixed by #33
Closed

Returning references with AsString method #31

Pepiloto opened this issue Feb 15, 2022 · 1 comment · Fixed by #33
Assignees
Labels
enhancement New feature or request

Comments

@Pepiloto
Copy link

Description

Why returning a copy instead of a reference in the AsString method in struct Node ?
String AsString() const { return std::get<String>(*this); }
It's a good practice to return references instead of copies.

Is your feature request related to a problem? Please describe.

I'm frustrated because I can't return const references with my configuration because it's causing a warning during compilation.

Describe the solution you'd like

Return references or const references.

@Pepiloto Pepiloto added the enhancement New feature or request label Feb 15, 2022
@rojas-diego
Copy link
Collaborator

We'll look into it today! Thanks

@Romain-1 Romain-1 mentioned this issue Feb 20, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants