-
Notifications
You must be signed in to change notification settings - Fork 15
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 some convenience operators to observable #994
Conversation
These seem like they would be used frequently enough for an observable type, especially the comparison operators which are critical to the
auto operator/(const T& rhs) -> decltype(val * rhs) { return val / rhs; } | ||
auto operator+(const T& rhs) -> decltype(val * rhs) { return val + rhs; } | ||
auto operator-(const T& rhs) -> decltype(val * rhs) { return val - rhs; } | ||
}; |
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 operators don't seem to be hit at all via the unit test. I mean, I can remove them and the test still compiles and runs.
I suspect it's because operator const T&(void) const { return val; }
already does everything we need.
Still investigating.
@@ -100,3 +99,16 @@ struct marshaller<observable<T>> : | |||
}; | |||
|
|||
} | |||
|
|||
namespace std { |
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.
Nice addition, this will be handy
These seem like they would be used frequently enough for an observable type, especially the comparison operators which are critical to the
@jdonald update: It seems we need only the hash function.