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

Avoid variable template in hp::Refinement #9186

Merged
merged 1 commit into from Dec 23, 2019

Conversation

masterleinad
Copy link
Member

Fixes the failing build in https://cdash.43-1.org/viewBuildError.php?onlydeltap&buildid=3370.
Generic lambdas are a C++14 feature.

@kronbichler
Copy link
Member

/rebuild

Copy link
Member

@bangerth bangerth left a comment

Choose a reason for hiding this comment

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

OK if you mark the two variables as const.

ComparisonFunction<Number> compare_false =
[](const Number &, const Number &) { return false; };
ComparisonFunction<Number> compare_true =
[](const Number &, const Number &) { return true; };
Copy link
Member

Choose a reason for hiding this comment

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

can you make these const?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@bangerth
Copy link
Member

As a complete aside, it's not that the thing is a generic lambda (which would be a structure with a template <typename T> operator() (...arguments depending on T...)), but it's the fact that the variable that the lambda is assigned to is a template: https://en.cppreference.com/w/cpp/language/variable_template This is not allowed in C++11, whereas the definition of the lambda itself had a clearly specified argument list (no template) that should have been ok.

Either way, the change is of course correct -- thanks for tackling it!

@masterleinad
Copy link
Member Author

Yes, you are right.

@masterleinad masterleinad changed the title Avoid generic lambda in hp::Refinement Avoid variable template in hp::Refinement Dec 23, 2019
@masterleinad masterleinad merged commit 6278256 into dealii:master Dec 23, 2019
@masterleinad masterleinad deleted the avoid_generic_lambda branch December 23, 2019 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants