Skip to content
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

Fix macos compile #2591

Merged
merged 1 commit into from
Jun 24, 2017

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Jun 24, 2017

Please use override not virtual in sub-classes.
override can check if there is a method in parent while compiling.

Fix #2588

Please use `override` not `virtual` in sub-classes.
`override` can check if there is a method in `parent` while compiling.
@reyoung reyoung mentioned this pull request Jun 24, 2017
@reyoung reyoung requested a review from jacquesqiao June 24, 2017 09:05
@jacquesqiao
Copy link
Member

Thanks @reyoung tell me that In subclass we should write only virtual or only override, if we use both, clang will throw error like "error: 'xxx' overrides a member function but is not marked 'override'"

LGTM!

@jacquesqiao jacquesqiao merged commit 7573e9e into PaddlePaddle:develop Jun 24, 2017
@@ -309,35 +309,35 @@ class CombinedEvaluator : public Evaluator {
void addEvaluator(std::unique_ptr<Evaluator>&& evaluator) {
evaluators_.emplace_back(std::move(evaluator));
}
virtual void start() {
void start() override {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it -- why is keyword override a key to Mac OS X build? @reyoung @jacquesqiao

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I got it from @jacquesqiao 's comment.

@reyoung reyoung deleted the feature/fix_macos_compile branch June 27, 2017 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants