summaryrefslogtreecommitdiffstats
path: root/src/tools/qlalr/lalr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qlalr/lalr.cpp')
-rw-r--r--src/tools/qlalr/lalr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index b9a9cf264f..c7269bed5f 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -297,6 +297,12 @@ void Automaton::build ()
buildDefaultReduceActions ();
}
+#if defined(__cpp_lib_not_fn) && __cpp_lib_not_fn >= 201603
+# define Q_NOT_FN std::not_fn
+#else
+# define Q_NOT_FN std::not1
+#endif
+
void Automaton::buildNullables ()
{
bool changed = true;
@@ -307,7 +313,7 @@ void Automaton::buildNullables ()
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
{
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
+ NameList::iterator nn = std::find_if(rule->rhs.begin(), rule->rhs.end(), Q_NOT_FN(Nullable(this)));
if (nn == rule->rhs.end ())
changed |= nullables.insert (rule->lhs).second;
@@ -648,7 +654,7 @@ void Automaton::buildIncludesDigraph ()
if (! _M_grammar->isNonTerminal (*A))
continue;
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
+ NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), Q_NOT_FN(Nullable(this)));
if (first_not_nullable != rule->rhs.end ())
continue;