diff --git a/src/runtime/c/pgf/generator.h b/src/runtime/c/pgf/generator.h index 976bf677f..3f87bbea1 100644 --- a/src/runtime/c/pgf/generator.h +++ b/src/runtime/c/pgf/generator.h @@ -127,6 +127,19 @@ class PGF_INTERNAL_DECL PgfExhaustiveGenerator : public PgfGenerator, public Pgf typedef std::pair,Scope*> Goal; + class CompareGoal : public std::less { + public: + bool operator() (const Goal &g1, const Goal &g2) const { + int cmp = textcmp(g1.first,g2.first); + if (cmp < 0) + return true; + else if (cmp > 0) + return false; + + return (g1.second < g2.second); + } + }; + struct Result { size_t ref_count; Scope *scope; @@ -154,7 +167,7 @@ class PGF_INTERNAL_DECL PgfExhaustiveGenerator : public PgfGenerator, public Pgf } }; - std::map results; + std::map results; std::priority_queue, CompareState> queue; std::vector scopes;