Skip to content

[0.10.6] __GNUC__ macro does not guarantee that std::scoped_ptr exists #828

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

Closed
Phibonacci opened this issue Oct 3, 2018 · 5 comments
Closed

Comments

@Phibonacci
Copy link

I compiled a GCC 7.3.0 on Centos 6 and compile my program using C++98 without the C++11 API thanks to the flag : -D_GLIBCXX_USE_CXX11_ABI=0.

The following code does not compile as scoped_ptr is not an std type.

#if __GNUC__ >= 6
typedef std::scoped_ptr<CharReader> const  CharReaderPtr;
#else
typedef std::auto_ptr<CharReader>          CharReaderPtr;
#endif

I don't know in which std version std::scoped_ptr exists but it does not seem to be part of the STL, if it was part of C++11 then a __cplusplus >= 201103L condition would solve the issue. GNUC only gives the GCC version and does not guarantee the presence of scoped_ptr.

To solve my issue I kept only the auto_ptr typedef.

@hkhatri241
Copy link

Please see #600

@cdunn2001
Copy link
Contributor

Oh, I understand #600 now. Is the necessary change already on the 0.y.z branch? And you only need a new 0.y.z release?

@Phibonacci
Copy link
Author

The issue comes from the 0.10.6 from the release section of GitHub.

The tip of the 0.x.y branch does not contain a scoped_ptr declaration. The preprocessing conditions have been removed and only the auto_ptr typdef remains.

I believe a new release would solve this issue.

@cdunn2001
Copy link
Contributor

Ok. I'll tag a new release tonight.

@cdunn2001
Copy link
Contributor

0.10.7

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