What is the right way to check if the new G4String is digit?

Sorry, maybe it’s a simple question.
What is the replacement to such command:
isdigit(G4String(i))

I am getting the next error:

error: no match for call to ‘(G4String) (int)’
if(isdigit(particle(i)) ) {
G4int pdgid = atoi(particle.c_str());

Thanks,
Volodymyr

If this is in Geant4 11, then the call operator(s) for G4String were removed as they just forwarded to other string methods. The full details are in the Release Notes for v11.0.0, but here the call operator can be replaced by the subscript operator:

if(isdigit(particle[i])

this is fully backward compatible with older Geant4 versions as G4String has always provided the subscript operator.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.