Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Make U macro less problematic #1214
Comments
|
See also a previous bug report. |
|
So far, the solution in my code is:
and, instead of |
I was getting compiler errors on ranges-v3 library when I included headers of this library. After wasting hours and almost giving up on this library, I found out that
Umacro is causing the issue and I can disable it by_TURN_OFF_PLATFORM_STRINGmacro.Since this has caused several issues (#812, #473, #435), we can take some actions to mitigate future problems:
1. Make the documentation more visible
The current documentation on this macro is obscure. I even skimmed through FAQ but didn't notice it at the end of paragraph:
Mentioning this macro in homepage or usage section can increase its visibility and prevent possible mistakes.
2. Rename it. Having it is undefined behavior
Based on C++ Standard, identifiers with an underscore followed by an uppercase letter are reserved and defining them would be undefined behavior. Having this is not a good practice in such a well-known library.
3. Deprecate and eventually remove
UWe can deprecate
Uand replace it with a more sensible macro definition. For keeping backward compatibility, we can have another macro (off by default) that when defined it brings backUfor the users that heavily depends on it.As reference (and helping the search engines), here is the compile errors I was getting:
ranges v-3: 0.4.0-1