From c5539d8711be4bbbf8e91e562d17903f704f7a89 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Fri, 27 Apr 2018 18:28:50 +0200
Subject: [PATCH] fix gcc-7 compilation error

---
 .../automaton/properties/efficient/ReachableStates.h   | 10 ++++++----
 .../src/automaton/properties/efficient/UsefullStates.h | 10 ++++++----
 .../simplify/efficient/UnreachableStatesRemover.h      |  8 +++++---
 .../simplify/efficient/UselessStatesRemover.h          |  6 ++++--
 4 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/alib2elgo/src/automaton/properties/efficient/ReachableStates.h b/alib2elgo/src/automaton/properties/efficient/ReachableStates.h
index 82b66de988..941f33fb18 100644
--- a/alib2elgo/src/automaton/properties/efficient/ReachableStates.h
+++ b/alib2elgo/src/automaton/properties/efficient/ReachableStates.h
@@ -31,16 +31,18 @@ public:
 	/**
 	 * Removes dead states from FSM. Melichar 2.29
 	 */
-	template < class T, class SymbolType = typename automaton::SymbolTypeOfAutomaton < T >, class StateType = typename automaton::StateTypeOfAutomaton < T > >
-	static ext::set<StateType> reachableStates( const T & fsm );
+	template < class T >
+	static ext::set < typename automaton::StateTypeOfAutomaton < T > > reachableStates( const T & fsm );
 	template < class SymbolType, class StateType >
 	static ext::set<StateType> reachableStates( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm );
 	template < class SymbolType, class StateType >
 	static ext::set<StateType> reachableStates( const automaton::DFA < SymbolType, StateType > & fsm );
 };
 
-template < class T, class SymbolType, class StateType >
-ext::set<StateType> ReachableStates::reachableStates( const T & fsm ) {
+template < class T >
+ext::set < typename automaton::StateTypeOfAutomaton < T > > ReachableStates::reachableStates( const T & fsm ) {
+	using StateType = typename automaton::StateTypeOfAutomaton < T >;
+
 	ext::map<StateType, ext::set<StateType>> transitions;
 	for(const auto& transition : fsm.getTransitions())
 		transitions[transition.first.first].insert(transition.second.begin(), transition.second.end());
diff --git a/alib2elgo/src/automaton/properties/efficient/UsefullStates.h b/alib2elgo/src/automaton/properties/efficient/UsefullStates.h
index c8be779645..66dce4db94 100644
--- a/alib2elgo/src/automaton/properties/efficient/UsefullStates.h
+++ b/alib2elgo/src/automaton/properties/efficient/UsefullStates.h
@@ -31,14 +31,16 @@ public:
 	/**
 	 * Removes dead states from FSM. Melichar 2.32
 	 */
-	template < class T, class SymbolType = typename automaton::SymbolTypeOfAutomaton < T >, class StateType = typename automaton::StateTypeOfAutomaton < T > >
-	static ext::set<StateType> usefullStates( const T & fsm );
+	template < class T >
+	static ext::set < typename automaton::StateTypeOfAutomaton < T > > usefullStates( const T & fsm );
 	template < class SymbolType, class StateType >
 	static ext::set<StateType> usefullStates( const automaton::DFA < SymbolType, StateType > & fsm );
 };
 
-template < class T, class SymbolType, class StateType >
-ext::set<StateType> UsefullStates::usefullStates( const T & fsm ) {
+template < class T >
+ext::set < typename automaton::StateTypeOfAutomaton < T > > UsefullStates::usefullStates( const T & fsm ) {
+	using StateType = typename automaton::StateTypeOfAutomaton < T >;
+
 	ext::map<StateType, ext::set<StateType>> reversedTransitions;
 	for(const auto& transition : fsm.getTransitions())
 		for(const StateType& to : transition.second)
diff --git a/alib2elgo/src/automaton/simplify/efficient/UnreachableStatesRemover.h b/alib2elgo/src/automaton/simplify/efficient/UnreachableStatesRemover.h
index c5f1f1749d..4a93bd1dd9 100644
--- a/alib2elgo/src/automaton/simplify/efficient/UnreachableStatesRemover.h
+++ b/alib2elgo/src/automaton/simplify/efficient/UnreachableStatesRemover.h
@@ -32,7 +32,7 @@ public:
 	/**
 	 * Removes dead states from FSM. Melichar 2.29
 	 */
-	template<class T, class SymbolType = typename automaton::SymbolTypeOfAutomaton < T >, class StateType = typename automaton::StateTypeOfAutomaton < T > >
+	template < class T >
 	static T remove( const T & automaton );
 	template < class SymbolType, class StateType >
 	static automaton::DFA < SymbolType, StateType > remove( const automaton::DFA < SymbolType, StateType > & fsm );
@@ -40,8 +40,10 @@ public:
 	static automaton::MultiInitialStateNFA < SymbolType, StateType > remove( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm );
 };
 
-template < class T, class SymbolType, class StateType >
-T UnreachableStatesRemover::remove( const T & fsm ) {
+template < class T >
+T UnreachableStatesRemover::remove ( const T & fsm ) {
+	using StateType = typename automaton::StateTypeOfAutomaton < T >;
+
 	// 1a
 	ext::set<StateType> Qa = automaton::properties::efficient::ReachableStates::reachableStates( fsm );
 
diff --git a/alib2elgo/src/automaton/simplify/efficient/UselessStatesRemover.h b/alib2elgo/src/automaton/simplify/efficient/UselessStatesRemover.h
index e8eb8b1aa0..cb32c30859 100644
--- a/alib2elgo/src/automaton/simplify/efficient/UselessStatesRemover.h
+++ b/alib2elgo/src/automaton/simplify/efficient/UselessStatesRemover.h
@@ -32,7 +32,7 @@ public:
 	/**
 	 * Removes dead states from FSM. Melichar 2.29
 	 */
-	template<class T, class SymbolType = typename automaton::SymbolTypeOfAutomaton < T >, class StateType = typename automaton::StateTypeOfAutomaton < T > >
+	template < class T >
 	static T remove( const T & automaton );
 	template < class SymbolType, class StateType >
 	static automaton::DFA < SymbolType, StateType > remove( const automaton::DFA < SymbolType, StateType > & fsm );
@@ -40,8 +40,10 @@ public:
 	static automaton::MultiInitialStateNFA < SymbolType, StateType > remove( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm );
 };
 
-template<class T, class SymbolType, class StateType >
+template < class T >
 T UselessStatesRemover::remove( const T & fsm ) {
+	using StateType = typename automaton::StateTypeOfAutomaton < T >;
+
 	// 1.
 	ext::set<StateType> Qu = automaton::properties::efficient::UsefullStates::usefullStates( fsm );
 
-- 
GitLab