Forbid adding of two functions with the exact same signature
This commit is contained in:
@@ -102,7 +102,7 @@ namespace dispatchkit
|
||||
virtual ~Proxy_Function() {}
|
||||
virtual Boxed_Value operator()(const std::vector<Boxed_Value> ¶ms) = 0;
|
||||
virtual std::vector<Type_Info> get_param_types() = 0;
|
||||
|
||||
virtual bool operator==(const Proxy_Function &) const = 0;
|
||||
};
|
||||
|
||||
class Dynamic_Proxy_Function : public Proxy_Function
|
||||
@@ -113,6 +113,11 @@ namespace dispatchkit
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==(const Proxy_Function &f) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual ~Dynamic_Proxy_Function() {}
|
||||
|
||||
virtual Boxed_Value operator()(const std::vector<Boxed_Value> ¶ms)
|
||||
@@ -146,7 +151,16 @@ namespace dispatchkit
|
||||
|
||||
virtual ~Proxy_Function_Impl() {}
|
||||
|
||||
|
||||
virtual bool operator==(const Proxy_Function &t_func) const
|
||||
{
|
||||
try {
|
||||
dynamic_cast<const Proxy_Function_Impl<Func> &>(t_func);
|
||||
return true;
|
||||
} catch (const std::bad_cast &) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
virtual Boxed_Value operator()(const std::vector<Boxed_Value> ¶ms)
|
||||
{
|
||||
return call_func(m_f, params);
|
||||
|
Reference in New Issue
Block a user