-
Notifications
You must be signed in to change notification settings - Fork 1.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
moved *InferModel
classes to infer.{cpp|h}
#6922
base: main
Are you sure you want to change the base?
Conversation
As suggested by @pfultz2 in #6845 (comment). |
lib/infer.cpp
Outdated
@@ -390,6 +390,7 @@ std::vector<MathLib::bigint> getMaxValue(const ValuePtr<InferModel>& model, cons | |||
|
|||
namespace { | |||
struct IntegralInferModel : InferModel { | |||
private: |
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.
Why is private being added? I don't think it's necessary and it's a little confusing since the interface is public.
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.
That is so it can only call it through the interface and not on the object it inherits from.
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.
Why? Its faster calling it directly(there is no vtable lookup).
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.
In that case - why having an interface?
Also this change is probably pedantic because the callers will never see the actual implementation and only use the interface.
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.
In that case - why having an interface?
So we can check that the interface is implemented correctly. Also if this is used across TUs we will need the interface, but if its in the same TU we can use a template function and use REQUIRES("T must be an InferModel", std::is_base_of<T, InferModel>)
to improve error messages.
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.
Also if this is used across TUs we will need the interface, but if its in the same TU we can use a template function and use
REQUIRES("T must be an InferModel", std::is_base_of<T, InferModel>)
to improve error messages.
Interesting point. I was wondering if there was some cleanup which could be done now they are all in the same place. Will look into it.
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.
I dropped commit making things private
for now.
No description provided.