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.
Macro U collides with Armadillo #812
Comments
|
@SanPen You can add a compiler flag |
|
|
|
We redefined it in our code to USTR for exactly this reason.
… On Jul 31, 2018, at 3:41 PM, Daniel Frey ***@***.***> wrote:
U is a really bad name, a user of our library was also using cpprestsdk and we used U as the name of a template parameter, think template< typename T, typename U >. Later we used U as a return type for a function pointer, something like using func_t = U(*)(int,int); - and that didn't work because of the macro U. Please stop defining macros with extremely common names.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#812 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABQZ0qzmp3rzSO-Lsi8Nrt70aFQzy-Qwks5uMM79gaJpZM4VWTR1>.
|
|
Exactly, I also changed it to USTR, but whenever I update the code or someone else downloads cpprestskd to use it with my code, they have to rename the macro as well. So, it would be very helpfull to rename this macro (and potentially others) to something harder to be used by others. |
|
We completely agree that The correct mechanism to address this problem is what @aksswami has suggested: define |
The macro
#define U(x) _XPLATSTR(x)collides somehow with the linear algebra library Armadillo.If I rename the macro, it all works.
I think it is worth mentioning.