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

Structured bindings for functions that might "return" multiple things #31

Open
jonesmz opened this issue Feb 6, 2019 · 0 comments
Open
Labels
C++17 The last set of patches (Until C++20 is out) patch Intended to be part of the patch series that makes up splinter

Comments

@jonesmz
Copy link

jonesmz commented Feb 6, 2019

https://en.cppreference.com/w/cpp/language/structured_binding

Functions such as those that accept an optional pointer-to-string to allow the called to be informed of errors are good candidates for this.

Either returning an empty std::string to indicate no error, or returning an std::optional, depending on if std::string's default constructor allocates on any known std implementations (It does in some older standard libs, but it's unclear if the standard has changed to prohibit that.)

@jonesmz jonesmz added patch Intended to be part of the patch series that makes up splinter C++17 The last set of patches (Until C++20 is out) labels Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++17 The last set of patches (Until C++20 is out) patch Intended to be part of the patch series that makes up splinter
Projects
None yet
Development

No branches or pull requests

1 participant