From 7942c75a19d6dd1f20b56ba571712cd1cebb5323 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 8 Aug 2017 08:48:51 +0200 Subject: [PATCH] move iterator extensions to ext namespace --- alib2algo/src/automaton/run/Run.h | 6 +++--- alib2algo/src/automaton/transform/PDAToRHPDA.cpp | 2 +- alib2algo/src/regexp/glushkov/GlushkovLast.h | 2 +- alib2std/src/extensions/forward_tree.hpp | 2 +- alib2std/src/extensions/iterator.hpp | 4 ++-- alib2std/src/extensions/tree.hpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/alib2algo/src/automaton/run/Run.h b/alib2algo/src/automaton/run/Run.h index 1c96c999fb..90b1baa15e 100644 --- a/alib2algo/src/automaton/run/Run.h +++ b/alib2algo/src/automaton/run/Run.h @@ -297,7 +297,7 @@ std::tuple < bool, StateType, std::set < unsigned >, std::deque < PushdownStoreS for ( unsigned j = 0; j < operation.first.size ( ); j++ ) pushdownStore.pop_back ( ); - for ( const auto & push : std::make_reverse ( operation.second ) ) pushdownStore.push_back ( push ); + for ( const auto & push : ext::make_reverse ( operation.second ) ) pushdownStore.push_back ( push ); state = transition->second; i++; @@ -501,7 +501,7 @@ std::tuple < bool, StateType, std::set < unsigned >, std::deque < PushdownStoreS for ( unsigned j = 0; j < std::get < 2 > ( transition->first ).size ( ); j++ ) pushdownStore.pop_back ( ); - for ( const auto & symbol : std::make_reverse ( transition->second.second ) ) pushdownStore.push_back ( symbol ); + for ( const auto & symbol : ext::make_reverse ( transition->second.second ) ) pushdownStore.push_back ( symbol ); state = transition->second.first; @@ -590,7 +590,7 @@ std::tuple < bool, std::set < StateType >, std::set < std::vector < OutputSymbol stackNodeCopy = stackNodeCopy -> m_parent; } if ( j == pop . size () ) { - for ( const auto & elem : std::make_reverse ( std::get<1>(transition . second ) ) ) { + for ( const auto & elem : ext::make_reverse ( std::get<1>(transition . second ) ) ) { stackNodeCopy = std::make_shared < graphStructuredStack < InputSymbolType > > ( stackNodeCopy, elem ); } for ( const auto & elem : std::get<2>(transition . second) ) { diff --git a/alib2algo/src/automaton/transform/PDAToRHPDA.cpp b/alib2algo/src/automaton/transform/PDAToRHPDA.cpp index c706b7719f..b792aa553b 100644 --- a/alib2algo/src/automaton/transform/PDAToRHPDA.cpp +++ b/alib2algo/src/automaton/transform/PDAToRHPDA.cpp @@ -89,7 +89,7 @@ automaton::RealTimeHeightDeterministicDPDA < > PDAToRHPDA::convert ( const autom popPushIndex++; } - for ( const DefaultSymbolType & push : std::make_reverse ( to.second ) ) { + for ( const DefaultSymbolType & push : ext::make_reverse ( to.second ) ) { DefaultStateType fromState = ( popPushIndex == 0 ) ? std::get < 0 > ( transition.first ) : lastUS; if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( ++i ) ), res.getStates ( ) ); diff --git a/alib2algo/src/regexp/glushkov/GlushkovLast.h b/alib2algo/src/regexp/glushkov/GlushkovLast.h index cf71bfa501..643d3362ee 100644 --- a/alib2algo/src/regexp/glushkov/GlushkovLast.h +++ b/alib2algo/src/regexp/glushkov/GlushkovLast.h @@ -72,7 +72,7 @@ template < class SymbolType > std::set < regexp::UnboundedRegExpSymbol < SymbolType > > GlushkovLast::Unbounded < SymbolType >::visit ( const regexp::UnboundedRegExpConcatenation < SymbolType > & node ) { std::set < regexp::UnboundedRegExpSymbol < SymbolType > > ret; - for ( const auto & element : std::make_reverse ( node.getElements ( ) ) ) { + for ( const auto & element : ext::make_reverse ( node.getElements ( ) ) ) { std::set < regexp::UnboundedRegExpSymbol < SymbolType > > tmp = element->template accept < std::set < regexp::UnboundedRegExpSymbol < SymbolType > >, GlushkovLast::Unbounded < SymbolType > > ( ); ret.insert ( tmp.begin ( ), tmp.end ( ) ); diff --git a/alib2std/src/extensions/forward_tree.hpp b/alib2std/src/extensions/forward_tree.hpp index e357706d68..41e031f7dc 100644 --- a/alib2std/src/extensions/forward_tree.hpp +++ b/alib2std/src/extensions/forward_tree.hpp @@ -371,7 +371,7 @@ public: forward_tree ( T && data, Types ... subtrees ) : forward_tree ( std::move ( data ), std::vector < forward_tree > { subtrees ... } ) { } - template < typename Iterator, typename std::enable_if < std::is_iterator < Iterator >::value >::type > + template < typename Iterator, typename std::enable_if < ext::is_iterator < Iterator >::value >::type > forward_tree ( const T & data, Iterator begin, Iterator end ) : forward_tree ( data, fromIterator ( begin, end ) ) { } diff --git a/alib2std/src/extensions/iterator.hpp b/alib2std/src/extensions/iterator.hpp index 446454fcf5..46694aaa07 100644 --- a/alib2std/src/extensions/iterator.hpp +++ b/alib2std/src/extensions/iterator.hpp @@ -10,7 +10,7 @@ #include <iterator> -namespace std { +namespace ext { template<class T> class reverser { @@ -40,6 +40,6 @@ struct is_iterator : std::false_type {}; template < typename T > struct is_iterator<typename std::iterator_traits<T>> : std::true_type {}; -} /* namespace std */ +} /* namespace ext */ #endif /* __ITERATOR_HPP_ */ diff --git a/alib2std/src/extensions/tree.hpp b/alib2std/src/extensions/tree.hpp index 81e568df41..02a758b000 100644 --- a/alib2std/src/extensions/tree.hpp +++ b/alib2std/src/extensions/tree.hpp @@ -379,7 +379,7 @@ public: tree ( T && data, Types ... subtrees ) : tree ( std::move ( data ), std::vector < tree > { subtrees ... } ) { } - template < typename Iterator, typename std::enable_if < std::is_iterator < Iterator >::value >::type > + template < typename Iterator, typename std::enable_if < ext::is_iterator < Iterator >::value >::type > tree ( const T & data, Iterator begin, Iterator end ) : tree ( data, fromIterator ( begin, end ) ) { } -- GitLab