File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -371,15 +371,31 @@ namespace classdesc
371
371
else
372
372
{
373
373
if (auto functions=dynamic_cast <RESTProcessOverloadedFunction*>(i->second .get ()))
374
- functions->overloadedFunctions .emplace_back (rp);
374
+ {
375
+ // replace if signature the same
376
+ for (auto & f: functions->overloadedFunctions )
377
+ if (f->signature ()==rp->signature ())
378
+ {
379
+ i->second .reset (rp);
380
+ return ;
381
+ }
382
+ functions->overloadedFunctions .emplace_back (rp);
383
+ }
375
384
else
376
385
{
377
386
auto firstFunction=dynamic_pointer_cast<RESTProcessFunctionBase>(i->second );
387
+ // replace if signature the same
388
+ if (firstFunction->signature ()==rp->signature ())
389
+ {
390
+ i->second .reset (rp);
391
+ return ;
392
+ }
378
393
auto functs=std::make_shared<RESTProcessOverloadedFunction>();
379
394
if (firstFunction) functs->overloadedFunctions .push_back (std::move (firstFunction));
380
395
functs->overloadedFunctions .emplace_back (rp);
381
396
i->second =functs;
382
397
}
398
+
383
399
}
384
400
}
385
401
@@ -1258,7 +1274,7 @@ namespace classdesc
1258
1274
// template <class T> bool partiallyMatchable(const json5_parser::mValue& x);
1259
1275
1260
1276
template <class T >
1261
- typename enable_if<is_floating_point<typename remove_reference<T>::type >, bool >::T partiallyMatchable (const REST_PROCESS_BUFFER& x)
1277
+ typename enable_if<is_floating_point<T >, bool >::T partiallyMatchable (const REST_PROCESS_BUFFER& x)
1262
1278
{return x.type ()==RESTProcessType::float_number||x.type ()==RESTProcessType::int_number;}
1263
1279
1264
1280
template <class T >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ namespace classdesc
18
18
{
19
19
std::string ret;
20
20
std::vector<std::string> args;
21
+ bool operator ==(const Signature& s) const {return args==s.args ;}
21
22
};
22
23
}
23
24
You can’t perform that action at this time.
0 commit comments