X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fparser%2Fparse_context.h;h=60151fd37988af0538f6b000bd50285930ee8d7d;hp=1145a871cb4b2da67a95373d44ea0812ab2567a5;hb=9a4f392521083d28e1c238e7898ab1d2ac5b73cd;hpb=5375260fd145e474246b7a3cce0fc2e667bd4ec8 diff --git a/ginac/parser/parse_context.h b/ginac/parser/parse_context.h index 1145a871..60151fd3 100644 --- a/ginac/parser/parse_context.h +++ b/ginac/parser/parse_context.h @@ -3,7 +3,7 @@ * Interface to parser context. */ /* - * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +88,20 @@ typedef ex (*reader_func)(const exvector& args); * function pointer!! The unsigned has to correspond to the serial number of * the defined GiNaC function. */ -typedef std::map prototype_table; +class PrototypeLess +{ +public: + bool operator()(const prototype& p1, const prototype& p2) const + { + int s = p1.first.compare(p2.first); + if (s == 0) { + if ((p1.second == 0) || (p2.second == 0)) return false; + return p1.second < p2.second; + } + return s < 0; + } +}; +typedef std::map prototype_table; /** * Default prototype table.