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

Modernize codebase: optional instead of out-args #109

Open
sipa opened this issue Mar 28, 2022 · 0 comments
Open

Modernize codebase: optional instead of out-args #109

sipa opened this issue Mar 28, 2022 · 0 comments

Comments

@sipa
Copy link
Owner

sipa commented Mar 28, 2022

The codebase in several places uses constructions like functions that return a bool to communicate success/failure, and then actually put their output in a by-ref argument, e.g.:

template<typename Ctx> bool ToString(const Ctx& ctx, std::string& ret) const

With the code now using C++17, I think those should be retrofitted to use std::optional instead:

template<typename Ctx> std::optional<std::string> ToString(const Ctx& ctx) const

(and many other examples)

@sipa sipa changed the title Modernize codebase Modernize codebase: optional instead of out-args Mar 28, 2022
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