Skip to content

Commit 21d2156

Browse files
committed
'fix' const issue
1 parent 208c2f6 commit 21d2156

File tree

1 file changed

+4
-2
lines changed
  • include/maxplus/base/fsm

1 file changed

+4
-2
lines changed

include/maxplus/base/fsm/fsm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class State : public WithUniqueID {
148148
return this->outgoingEdges;
149149
}
150150

151-
void removeOutgoingEdge(Edge &e) { this->outgoingEdges.erase(&e); }
151+
void removeOutgoingEdge(const Edge &e) {
152+
this->outgoingEdges.erase(const_cast<Edge*>(&e));
153+
}
152154
void insertOutgoingEdge(Edge &e) { this->outgoingEdges.insert(&e); }
153155

154156
private:
@@ -459,7 +461,7 @@ class FiniteStateMachine : public Abstract::FiniteStateMachine {
459461
};
460462

461463
void removeEdge(const Edge<StateLabelType, EdgeLabelType> &e) {
462-
auto csrc = dynamic_cast<State<StateLabelType, EdgeLabelType> &>(e.getSource());
464+
auto csrc = dynamic_cast<const State<StateLabelType, EdgeLabelType> &>(e.getSource());
463465
// get a non-const version of the state
464466
auto src = this->getStateLabeled(csrc.getLabel());
465467
src.removeOutgoingEdge(e);

0 commit comments

Comments
 (0)