ROOT Version: 6.24.06
Platform: lxplus
In PyROOT, if one overloads function templates with argument types TH1* and TAxis*, only the function that is defined first will be loaded.
Reproducer:
import ROOT
import cppyy
cppyy.cppdef(r"""\
template<typename T>
T foo1(TH1* h)
{
return (T)1;
}
template<typename T>
T foo1(TAxis* ax)
{
return (T)1;
}
template<typename T>
T foo2(TAxis* h)
{
return (T)1;
}
template<typename T>
T foo2(TH1* ax)
{
return (T)1;
}
""")
h = ROOT.TH1D("h", "h", 1, 0, 1)
ax = h.GetXaxis()
# works
ROOT.foo1["float"](h)
# fails
ROOT.foo2["float"](h)
# works
ROOT.foo2["float"](ax)
# fails
ROOT.foo1["float"](ax)