diff --git a/alib2cli/src/parser/Parser.h b/alib2cli/src/parser/Parser.h index 9f74c354cc87471530f653f14b16eb264853e78b..2a5c7b18aa0a3783b40a30bbce6ca0147455f184 100644 --- a/alib2cli/src/parser/Parser.h +++ b/alib2cli/src/parser/Parser.h @@ -34,13 +34,12 @@ public: template < class ... Tokens > bool check ( Tokens ... tokens ) const { - // TODO repace in c++17 with fold expressions - return ext::orAll ( m_current.m_type == tokens ... ); + return ( ... || ( m_current.m_type == tokens ) ); } template < class ... NonreservedTokens > bool check_nonreserved_kw ( const NonreservedTokens & ... kw ) const { - return m_current.m_type == Lexer::TokenType::IDENTIFIER && ext::orAll ( m_current.m_value == kw ... ); + return m_current.m_type == Lexer::TokenType::IDENTIFIER && ( ... || ( m_current.m_value == kw ) ); } template < class Token, class ... Tokens > diff --git a/alib2common/src/common/createUnique.hpp b/alib2common/src/common/createUnique.hpp index 5e49bb909556fd80f37b86e552e4e1e775aaed7b..677ba46103e1adae2c2fb321aae4e2f7509c2236 100644 --- a/alib2common/src/common/createUnique.hpp +++ b/alib2common/src/common/createUnique.hpp @@ -46,8 +46,7 @@ T createUnique ( T object, const Alphabets & ... alphabets ) { unsigned i = 0; do { - // TODO repace in c++17 with fold expressions - if ( ext::andAll ( alphabets.count ( object ) == 0 ... ) ) + if ( ( ... && ( alphabets.count ( object ) == 0 ) ) ) return object; inc ( object ); diff --git a/alib2std/src/extensions/algorithm.hpp b/alib2std/src/extensions/algorithm.hpp index e92dcadaff7fd71aceb3cc26006395f76fb22879..5efa54d9e4ecbdb47f2828e34e88aca4029e1baf 100644 --- a/alib2std/src/extensions/algorithm.hpp +++ b/alib2std/src/extensions/algorithm.hpp @@ -190,34 +190,6 @@ bool binary_contains(InputIt first, InputIt last, const Element& elem) { return binary_search(first, last, elem) != last; } -// TODO repace in c++17 with fold expressions -template < class ... Ts > -inline bool andAll ( Ts ... ); - -template < > -inline bool andAll ( ) { - return true; -} - -template < class T, class ... Ts > -inline bool andAll ( T value, Ts ... other ) { - return value && andAll ( other ... ); -} - -// TODO repace in c++17 with fold expressions -template < class ... Ts > -inline bool orAll ( Ts ... ); - -template < > -inline bool orAll ( ) { - return false; -} - -template < class T, class ... Ts > -inline bool orAll ( T value, Ts ... other ) { - return value || orAll ( other ... ); -} - /** * \brief * Function to locate pair of iterators (openPos, closePos), i.e. both openPos and closePos are included in the range, where * openPos == \p open and closePos == \p closePos, or openPos = closePos = begin if no range can be found. diff --git a/alib2str/src/container/string/ObjectsVariant.h b/alib2str/src/container/string/ObjectsVariant.h index 448696768cd7af27e588fd3243e294d8f2744caa..5e59c7c67b0c35daf4ba13ba1b22122164958ba4 100644 --- a/alib2str/src/container/string/ObjectsVariant.h +++ b/alib2str/src/container/string/ObjectsVariant.h @@ -58,7 +58,7 @@ ext::variant < Types ... > stringApi < ext::variant < Types ... > >::parse ( std template < class ... Types > bool stringApi < ext::variant < Types ... > >::first ( std::istream & input ) { - return ext::andAll ( stringApi < Types >::first ( input ) ... ); + return ( ... && stringApi < Types >::first ( input ) ); } template < class ... Types >