-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There seems to be a name clash for the ROOT header and std::chrono's templates #365
Comments
I guess something wrong happens when one calls std::chrono::floor by basename (i.e. without namespace prefix). The statement above ends up with using of 'using namespace' with consequent calling of the bare floor template (without prefix). Well, let's reproduce it by ourselves:
Look, floor for std::chrono::duration works, unlike the example in the original message. Now let's rewrite it a bit:
In fact, floor for time_point is just a tiny wrapper for floor for duration, which calls bare floor, and that's where compilation fails:
I tried to insert std::chrono there (right to the 'chrono' header), and the code from my first message
got compiled. |
Add If you call |
@dpiparo ok to close? |
From the ROOT tracker ( this is a Vc issue) root-project/root#11934
(Thanks to https://github.com/telzhov for the original report, copied here as it was!)
Describe the bug
ROOT Vc/vector.h and std::chrono both use at least four same names in their namespaces, i.e. floor, ceil, round, and abs. std:: and std::chrono:: are the different name spaces of course, but trying to instantiate an std::chrono::time_point doesn't compile if a compilation unit include's Vc/vector.h header as well (or any that includes it, such as Math/Minimizer.h etc).
Expected behavior
It should compile.
To Reproduce
Here is an example:
Trying to build
Try to comment out the line which includes Vc/vector.h, and you'll find that it works
Setup
The text was updated successfully, but these errors were encountered: