From 55d651b7c470ba1c023e41ab0ca6c8eb4fd40436 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 19 Feb 2019 16:51:02 +0000 Subject: [PATCH] Constified std::map comparator (apparently MSVC fails to compile otherwise). Problem reported by Denis Naumov. --- re2c/src/dfa/closure.cc | 3 +-- re2c/src/dfa/determinization.cc | 2 +- re2c/src/dfa/determinization.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/re2c/src/dfa/closure.cc b/re2c/src/dfa/closure.cc index 5d2ce444..47bb4bcb 100644 --- a/re2c/src/dfa/closure.cc +++ b/re2c/src/dfa/closure.cc @@ -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, diff --git a/re2c/src/dfa/determinization.cc b/re2c/src/dfa/determinization.cc index aeb01ed2..4befd0db 100644 --- a/re2c/src/dfa/determinization.cc +++ b/re2c/src/dfa/determinization.cc @@ -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; diff --git a/re2c/src/dfa/determinization.h b/re2c/src/dfa/determinization.h index 0d80012b..f9bdf26f 100644 --- a/re2c/src/dfa/determinization.h +++ b/re2c/src/dfa/determinization.h @@ -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; }; -- 2.40.0