-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
For the readme's "For example, instead of writing this code:", the example could also be written using C++17's declaration-in-if syntax:
std::optional<image> get_cute_cat (const image& img) {
if (auto cropped = crop_to_cat(img)) {
if (auto with_tie = add_bow_tie(*cropped)) {
if (auto with_sparkles = make_eyes_sparkle(*with_tie)) {
return add_rainbow(make_smaller(*with_sparkles));
}
}
}
return std::nullopt;
}
I'm looking at the library because it's been mentioned on a Debian mailing list, but AFAICS the syntax built into C++17 already provides these benefits.
Metadata
Metadata
Assignees
Labels
No labels