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

noinitadaptor::destroy causes compiler error #81

Closed
SquaredPotato opened this issue Aug 21, 2020 · 3 comments
Closed

noinitadaptor::destroy causes compiler error #81

SquaredPotato opened this issue Aug 21, 2020 · 3 comments

Comments

@SquaredPotato
Copy link

SquaredPotato commented Aug 21, 2020

Error states
/opt/boost/1_74_0/include/boost/core/noinit_adaptor.hpp:58:10: error: expected a class name after '~' to name a destructor p->~U();

Compiling on MacOS with Clang 10.0.0., with the -std=c++20 flag.
I'm not sure why, but the error disappear when I replace the template class "U", with any other letter like "T", so that it looks like this:

    template<class T>
    void samefunction(T* p) {
        p->~T();
    }

instead of

    template<class U>
    void samefunction(U* p) {
         p->~U();
    }

Is this issue specific to my system? I can't seem to find anyone else having this problem.

EDIT:
Fixed by placing
#define _TURN_OFF_PLATFORM_STRING at the top of my main.c file.
Referenced in cpprestsdk issue 1214

@Lastique
Copy link
Member

Check if you have a macro U defined somewhere.

@SquaredPotato
Copy link
Author

SquaredPotato commented Aug 21, 2020

Thanks for the quick response, it turns out it is indeed a macro defined by cpprestsdk in basic_types.h.
I guess this issue can be closed as it isn't a boost issue.

@nperdijk
Copy link

I ran in the same issue as you. Thanks for your edit. That saved my day!

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

3 participants