Skip to content
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

Header ordering conflicts with Boost libraries #435

Open
cmazakas opened this issue May 8, 2017 · 9 comments
Open

Header ordering conflicts with Boost libraries #435

cmazakas opened this issue May 8, 2017 · 9 comments

Comments

@cmazakas
Copy link

cmazakas commented May 8, 2017

I'm using a combination of Boost and the cpprestsdk but unfortunately, because of the definition of U, the user will get cryptic parser failures in the Boost implementation of type_traits. To remedy this, I have to include all of my Boost dependencies before any cpprestsdk header files. There's also a macro one can define to make header ordering irrelevant: #define _TURN_OFF_PLATFORM_STRING

See: microsoft/vcpkg#836

@ksinica
Copy link

ksinica commented Sep 11, 2017

I've run into the same issue today:
boost/move/detail/type_traits.hpp(757): error C2187: syntax error: ')' was unexpected here

U is a very popular name for a template parameter, and this unfortunate definition may result in ill-formed code (taken directly from boost/move/detail/type_traits.hpp):

template <class U>
static yes_type test(U&, decltype(U(source<U>()))* = 0);

@chri7325
Copy link

We have also had to make the same fix in our codebase while moving to VS2017.

@HumamHelfawi
Copy link

Any intention to fix this soon? Any news?

@garethsb
Copy link
Contributor

garethsb commented May 1, 2018

Ability to use _TURN_OFF_PLATFORM_STRING successfully should be resolved by #693 on master at Feb 7. Hopefully will be in a v2.10.3 soon.

@svebert
Copy link

svebert commented Jan 6, 2019

Hi,
I just stumbled over this issue. I installed cpprest via vcpkg on Windows. In that specific version (cpprest_2_10) this problem ist not fixed. I am not sure, whether only the cpprest release in vcpkg is too old (I installed it on 1.1.2019) or if it is still not fixed in the master.

@KindDragon
Copy link
Contributor

Please remove macros U from cpprestsdk

@milanchandna
Copy link

Ran into the same issue.

I was using auto-generated client stubs from Swagger which internally uses boost and cpprest.
This issue is forcing me to change auto-generated code which I was trying to avoid.
Either I have to use #undef U or include all boost dependencies before cpprest.

Please fix it.

@garethsb
Copy link
Contributor

@svebert @milanchandna - as pointed out previously, this should be resolvable for every release since v2.10.3 (Aug 2, 2018) by defining the _TURN_OFF_PLATFORM_STRING in your project.

@milanchandna
Copy link

@garethsb-sony completely missed that workaround. Thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants