root
root copied to clipboard
Code generated by TFile::MakeProject should not rely on std namespace import
Explain what you would like to see improved
As discussed in the ROOT forum: the code generated by TFile::MakeProject
currently contains the following lines at the beginning
namespace std {} using namespace std;
which is necessary because the header files to not qualify std
names (e.g., vector
instead of std::vector
).
@Wile.E.Coyote provided the following comment in the forum:
Actually, it seems to me that the origin of the problem is that the “std::” was removed at the TTree creation time (i.e. if you try “tree->Print();”, you will see that it is not there). It seems to me that this is a long-standing problem which should be fixed (i.e. “std::” should be preserved).
Optional: share how it could be improved
It would be nicer if header files did qualify names from the std
namespace so that they can be easier included in other projects.
To Reproduce
Use TFile::MakeProject
on a ROOT file with a non-trivial tree.
Setup
- Master
- Arch Linux
- Built from sources
Changing the onfile normalized name might not be forward compatible (old version of ROOT not being able to read new files).
Can this be closed as won't fix given the comment of @pcanal ?
I am closing the issue. Please feel free to reopen if you have an answer to the question asked above.