-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Detect proto messages based on presence of DebugString. #2837
Conversation
Note that this required more metaprogramming magic that I'm really comfortable with, so I'm prepared for a few round-trips of feedback before this is ready to merge. Please let me know if this is the approach you had in mind @asoffer |
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.
These changes should be merged
Gentle ping :) |
template <typename T> | ||
struct IsAProtocolMessage | ||
: public std::is_convertible<const T*, const ::proto2::MessageLite*> {}; | ||
class IsAProtocolMessage { |
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.
Since we're no longer checking for being a protocol message but rather for DebugString and ShortDebugString, can we change the name to HasDebugStringAndShortDebugString?
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.
Sure. Should I do it here, or will you pull the changes in through Google's internal source control?
PiperOrigin-RevId: 336087297
PiperOrigin-RevId: 336087297
PiperOrigin-RevId: 336087297
PiperOrigin-RevId: 336087297
PiperOrigin-RevId: 336087297
PiperOrigin-RevId: 336087297
@inazarenko this should be working now though as you can see there are merge conflicts because we made a few tweaks to the implementation. Leaving this for you to close. |
fixes #2817 (allows open-source proto messages to be printed using DebugString).
Second attempt, since #2818 was rejected.