diff options
-rw-r--r-- | overloaddata.cpp | 12 | ||||
-rw-r--r-- | overloaddata.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/overloaddata.cpp b/overloaddata.cpp index 1be83241..3fd86baa 100644 --- a/overloaddata.cpp +++ b/overloaddata.cpp @@ -383,6 +383,18 @@ QPair<int, int> OverloadData::getMinMaxArguments(const AbstractMetaFunctionList return QPair<int, int>(minArgs, maxArgs); } +bool OverloadData::isSingleArgument(const AbstractMetaFunctionList overloads) +{ + bool singleArgument = true; + foreach (const AbstractMetaFunction* func, overloads) { + if (func->arguments().size() - numberOfRemovedArguments(func) > 1) { + singleArgument = false; + break; + } + } + return singleArgument; +} + void OverloadData::dumpGraph(QString filename) const { QFile file(filename); diff --git a/overloaddata.h b/overloaddata.h index a0970a2c..decbcfaf 100644 --- a/overloaddata.h +++ b/overloaddata.h @@ -75,6 +75,8 @@ public: static int numberOfRemovedArguments(const AbstractMetaFunction* func, int finalArgPos = -1); static QPair<int, int> getMinMaxArguments(const AbstractMetaFunctionList overloads); + /// Returns true if all overloads have no more than one argument. + static bool isSingleArgument(const AbstractMetaFunctionList overloads); void dumpGraph(QString filename) const; QString dumpGraph() const; |