| Summary: | logvol getName returns by value - could it return by ref? | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Thomas Kittelmann <thomas.kittelmann> |
| Component: | geometry/volumes | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | ||
| Priority: | P5 | ||
| Version: | 10.0 | ||
| Hardware: | All | ||
| OS: | All | ||
Thanks. This will be fixed in the next version! |
A very minor thing perhaps, but it actually bit me recently, so I thought I would ask for it to be fixed despite its tininess :-) The thing is, while G4VPhysicalVolume returns the string name by ref...: inline const G4String& GetName() const; ... G4LogicalVolume returns by value: inline G4String GetName() const; Could the G4LogicalVolume GetName() be made to return by ref as well? (actually, grepping for 'G4String GetName' in G4 headers I see that return by value occurs in other classes as well). The reason it bit me is that some compilers are now switching away from copy-on-write implementations of std::string (and the fact I was careless and assumed the LV GetName() was similar to PV GetName()). Cheers, Thomas