mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmGeneratorExpressionDAGChecker: Avoid const_cast
Make a member mutable to avoid casting away const of a whole object.
This commit is contained in:
@@ -68,9 +68,7 @@ void cmGeneratorExpressionDAGChecker::Initialize()
|
||||
return;
|
||||
}
|
||||
}
|
||||
const_cast<cmGeneratorExpressionDAGChecker*>(top)
|
||||
->Seen[this->Target]
|
||||
.insert(this->Property);
|
||||
top->Seen[this->Target].insert(this->Property);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ private:
|
||||
const cmGeneratorExpressionDAGChecker* const Parent;
|
||||
cmGeneratorTarget const* Target;
|
||||
const std::string Property;
|
||||
std::map<cmGeneratorTarget const*, std::set<std::string>> Seen;
|
||||
mutable std::map<cmGeneratorTarget const*, std::set<std::string>> Seen;
|
||||
const GeneratorExpressionContent* const Content;
|
||||
const cmListFileBacktrace Backtrace;
|
||||
Result CheckResult;
|
||||
|
||||
Reference in New Issue
Block a user