[PyROOT] cppyy selects explicit template instantiation
I maintainer di solito rispondono entro 1 giorno
@guitargeek ci sta già lavorando.
Dal 19/2/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Check duplicate issues.
- Checked for duplicates
Description
When a function takes a mandatory template argument that also cannot be deduced, cppyy sometimes uses an explicit instantiation.
Reproducer
>>> import ROOT
>>> ROOT.gInterpreter.Declare("template <typename T> std::size_t get_size() { return sizeof(T); }")
True
>>> ROOT.gInterpreter.Declare("template std::size_t get_size<int>();")
True
>>> ROOT.get_size()
4
>>> ROOT.get_size[""]()
4
I would expect the call to fail:
>>> import ROOT
>>> ROOT.gInterpreter.Declare("template <typename T> std::size_t get_size() { return sizeof(T); }")
True
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
>>> ROOT.get_size[""]()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Could not find "get_size<>" (set cppyy.set_debug() for C++ errors):
Failed to instantiate "get_size<>()"
Interestingly, the behavior is different after it failed once:
>>> ROOT.gInterpreter.Declare("template std::size_t get_size<int>();")
True
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
>>> ROOT.get_size[""]()
4
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
Now it only works with get_size[""]()...?!
ROOT version
master
Installation method
from source
Operating system
Linux
Additional context
No response
- Lingua principale
- C++
- Stelle
- 3.3k
- Fork
- 1.6k
- Merge medio
- 2g 7h
- PR unite (30g)
- 180
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlineForse già presa @dpiparo l’ha presa 6 giorni fa. Apertabug in:Build System
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
root-project/root#23746 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an errorForse già presa @lmoneta l’ha presa 16 giorni fa. ApertaAI-Assisted bug in:SOFIE
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
root-project/root#23655 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[graph] TScatter / TScatter2D stops drawing remaining points if a non-positive value is encountered in log scaleForse già presa @muntasir-396 l’ha presa oggi. Apertabug in:Graphics
root-project/root#23833 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCintForse già presa @pcanal l’ha presa 3 giorni fa. Apertabug in:Core Libraries
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
root-project/root#23777 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`TChain::GetEntries` internal caching ineffective?Forse già presa @pcanal l’ha presa 9 giorni fa. Apertaimprovement in:TTree
root-project/root#23738 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di root-project/root
Issue simili
-
bug IO
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MrNeRF/LichtFeld-Studio#3824 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug code-review testing tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aristocratos/btop#1945 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
boykopovar/AnyPS5#11291 ·
I maintainer di solito rispondono entro 1 giorno