]> granicus.if.org Git - re2c/commitdiff
Constified std::map comparator (apparently MSVC fails to compile otherwise).
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 19 Feb 2019 16:51:02 +0000 (16:51 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 19 Feb 2019 16:51:02 +0000 (16:51 +0000)
Problem reported by Denis Naumov.

re2c/src/dfa/closure.cc
re2c/src/dfa/determinization.cc
re2c/src/dfa/determinization.h

index 5d2ce444c1f9a8536f0c22a45b61196a64122b0c..47bb4bcbeb3d27124fcacf446de5398c974c6f0e 100644 (file)
@@ -165,8 +165,7 @@ void generate_versions(determ_context_t &ctx)
     newvers_t &newvers = ctx.dc_newvers;
 
     clositer_t b = clos.begin(), e = clos.end(), c;
-    newver_cmp_t cmp(thist, ctx.dc_hc_caches);
-    newvers_t newacts(cmp);
+    newvers_t newacts(newver_cmp_t(thist, ctx.dc_hc_caches));
     tcmd_t *cmd = NULL;
 
     // for each tag, if there is at least one tagged transition,
index aeb01ed26e524d254bd01b3e1295363ef3e984bb..4befd0db763d976372c2b062c519452b5910bafe 100644 (file)
@@ -261,7 +261,7 @@ dfa_t::~dfa_t()
 }
 
 
-bool newver_cmp_t::operator()(const newver_t &x, const newver_t &y)
+bool newver_cmp_t::operator()(const newver_t &x, const newver_t &y) const
 {
     if (x.tag < y.tag) return true;
     if (x.tag > y.tag) return false;
index 0d80012b009ed0244fa7450e7cf9fadbaee84b20..f9bdf26f6c7052c2caf387bc9ab4971d72982a02 100644 (file)
@@ -66,7 +66,7 @@ struct newver_cmp_t
     hc_caches_t &caches;
 
     newver_cmp_t(tag_history_t &h, hc_caches_t &c): history(h), caches(c) {}
-    bool operator()(const newver_t &, const newver_t &);
+    bool operator()(const newver_t &, const newver_t &) const;
 };