@@ -1463,23 +1463,6 @@ bool Cppyy::IsTemplatedMethod(TCppMethod_t method)
1463
1463
return Cpp::IsTemplatedFunction (method);
1464
1464
}
1465
1465
1466
- // // helpers for Cppyy::GetMethodTemplate()
1467
- // static std::map<TDictionary::DeclId_t, CallWrapper*> gMethodTemplates;
1468
- //
1469
- // static inline
1470
- // void remove_space(std::string& n) {
1471
- // std::string::iterator pos = std::remove_if(n.begin(), n.end(), isspace);
1472
- // n.erase(pos, n.end());
1473
- // }
1474
- //
1475
- // static inline
1476
- // bool template_compare(std::string n1, std::string n2) {
1477
- // if (n1.back() == '>') n1 = n1.substr(0, n1.size()-1);
1478
- // remove_space(n1);
1479
- // remove_space(n2);
1480
- // return n2.compare(0, n1.size(), n1) == 0;
1481
- // }
1482
- //
1483
1466
Cppyy::TCppMethod_t Cppyy::GetMethodTemplate (
1484
1467
TCppScope_t scope, const std::string& name, const std::string& proto)
1485
1468
{
@@ -1510,17 +1493,15 @@ Cppyy::TCppMethod_t Cppyy::GetMethodTemplate(
1510
1493
Cppyy::AppendTypesSlow (proto, arg_types);
1511
1494
Cppyy::AppendTypesSlow (explicit_params, templ_params);
1512
1495
1513
- Cppyy::TCppMethod_t cppmeth = nullptr ;
1496
+ Cppyy::TCppMethod_t cppmeth = Cpp::BestOverloadFunctionMatch (
1497
+ unresolved_candidate_methods, templ_params, arg_types);
1514
1498
1515
- if (unresolved_candidate_methods.size () == 1 && !templ_params.empty ())
1499
+ if (!cppmeth && unresolved_candidate_methods.size () == 1 &&
1500
+ !templ_params.empty ())
1516
1501
cppmeth =
1517
1502
Cpp::InstantiateTemplate (unresolved_candidate_methods[0 ],
1518
1503
templ_params.data (), templ_params.size ());
1519
1504
1520
- if (!cppmeth)
1521
- cppmeth = Cpp::BestOverloadFunctionMatch (unresolved_candidate_methods,
1522
- templ_params, arg_types);
1523
-
1524
1505
return cppmeth;
1525
1506
1526
1507
// if it fails, use Sema to propogate info about why it failed (DeductionInfo)
0 commit comments