Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /cmajor++/Cm/Cm.Core/FunctionSet.hpp [r367] .. [r368] Maximize Restore

  Switch to side-by-side view

--- a/cmajor++/Cm/Cm.Core/FunctionSet.hpp
+++ b/cmajor++/Cm/Cm.Core/FunctionSet.hpp
@@ -55,7 +55,8 @@
     virtual ObjectPtr Clone(CloneContext& context) const;
     virtual bool IsFunctionSet() const { return true; }
     virtual bool IsImportObject() const { return true; }
-    const FunctionVec& Overloads() const { return overloadVec; }
+    int NumOverloads() const { return overloadSet.size(); }
+    FunctionPtr GetFirstOverload() const;
     void AddOverload(const FunctionPtr& overload);
     FunctionPtr GetOverload(const ArgumentVector& arguments, const ScopeLookupSet& scopes);
     FunctionPtr GetOverload(const std::string& overloadName, const ScopeLookupSet& scopes);
@@ -71,8 +72,9 @@
     virtual void TypeCheckBody(TypeCheckContext& context);
     virtual ObjectPtr Instantiate(ExpressionList& templateArguments, TypeCheckContext& context);
     virtual void Print(CodeFormatter&) {}
+    virtual InstantiationStatus GetInstantiationStatus() const { return InstantiationStatus::not_instantiated; }
 private:
-    FunctionVec overloadVec;
+    std::set<FunctionPtr> overloadSet;
 };
 
 typedef std::shared_ptr<FunctionSet> FunctionSetPtr;
@@ -91,6 +93,7 @@
     virtual bool HasTypeCheckReplacement(TypeCheckContext& context) const;
     virtual ObjectPtr GetTypeCheckReplacement(TypeCheckContext& context) const;
     virtual void Print(CodeFormatter&) {}
+    virtual InstantiationStatus GetInstantiationStatus() const { return InstantiationStatus::not_instantiated; }
 private:
     FunctionSetPtr linkedFunctionSet;
 };