1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

AK+Everywhere: Make Variant::visit() respect the Variant's constness

...and fix all the instances of visit() taking non-const arguments.
This commit is contained in:
Ali Mohammad Pur 2022-01-13 17:31:00 +03:30 committed by Ali Mohammad Pur
parent d55c130df5
commit 9de33629da
7 changed files with 44 additions and 31 deletions

View file

@ -35,13 +35,13 @@ MatchResult Supports::Condition::evaluate() const
MatchResult Supports::InParens::evaluate() const
{
return value.visit(
[&](NonnullOwnPtr<Condition>& condition) {
[&](NonnullOwnPtr<Condition> const& condition) {
return condition->evaluate();
},
[&](Feature& feature) {
[&](Feature const& feature) {
return feature.evaluate();
},
[&](GeneralEnclosed& general_enclosed) {
[&](GeneralEnclosed const& general_enclosed) {
return general_enclosed.evaluate();
});
}