-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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 printer for absl::monostate / std::monostate #2066
Comments
Printing the type when it is statically known is not that useful. But printing |
Thank you very much for this report. The best way to approach this would be to create a proper PR and submit it for consideration. |
@alex-weej any updates? |
@gennadiycivil, this could be added to #2438 which was rejected (I posted my thoughts on why it should be reconsidered there, but I got no answer). Can I ask you or anyone else to have a second look into that? |
After recent addition of std::variant printer, we'd print a type (if RTTI is available) and a value like this: // for regular types
std::variant<int> full = 100;
::testing::internal::UniversalPrint(full, &std::cout); // hack for brevity gives back: whereas: // for std::monostate
std::variant<std::monostate> empty;
::testing::internal::UniversalPrint(empty, &std::cout); returns: The question is whether it's good enough. |
We support variant, but it looks like monostate is still printing as 0-byte object.
Propose we print it as
{}
or()
. Hopefully the bikeshedding is not too strong on this one. I think spelling it "monostate" is going to be too verbose where this appears in nested values several times.The text was updated successfully, but these errors were encountered: