-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add Optional Support #3303
Add Optional Support #3303
Conversation
|
7756f40
to
92f98cf
Compare
92f98cf
to
fc57abb
Compare
d377588
to
1a62615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. For consistency with other formatters such as variant
I suggest replacing Option
with optional
and use lowercase empty
(or none
).
@vitaut sure, I was just thinking you might, rather, want to change the variant formatter (despite capitalization going against the standard library's convention). For readability. |
6d426a7
to
b890509
Compare
Thank you! |
A formatter for
std::optional
as per #1367 (comment)The code is just copied from barry's slideware where the specifier just get parsed through to the formatter of the underling type.
As such there is no customization of printing of the optional's container for which I originally went with the opinionated
Some(...)
andNone
, but then changed toOption(...)
andEmpty
. I'm not very convinced aboutnullopt
when you're trying to study complicated output: