Skip to content

Commit

Permalink
[Change] MakeC_NFA::setAction() method template.
Browse files Browse the repository at this point in the history
  • Loading branch information
buck-yeh committed Sep 24, 2024
1 parent 86034af commit 4d555ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/bux/FA.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class C_NFA
C_NFA &append(const C_NFA &a);
C_NFA &append(const T_Inputs &inputs);
C_NFA &changeTo(int options);
void setAction(T_Action &&action);
template<class T> void setAction(T &&action);
size_t totalFinalStates() const { return F.size(); }

private:
Expand Down Expand Up @@ -374,10 +374,11 @@ void C_NFA<T_Inputs,T_Action,C_Traits>::gatherStates(std::set<C_NfaState> &usedS
}

template<class T_Inputs, class T_Action, class C_Traits>
void C_NFA<T_Inputs,T_Action,C_Traits>::setAction(T_Action &&action)
template<class T>
void C_NFA<T_Inputs,T_Action,C_Traits>::setAction(T &&action)
{
for (auto &i: F)
i.m_Tag = std::forward<T_Action>(action);
i.m_Tag = std::forward<T>(action);
}

template<class T_Inputs, class T_Action, class C_Traits>
Expand Down

0 comments on commit 4d555ce

Please sign in to comment.