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

Doesn't compile under C++17 #1239

Closed
iphydf opened this issue Sep 14, 2018 · 5 comments
Closed

Doesn't compile under C++17 #1239

iphydf opened this issue Sep 14, 2018 · 5 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@iphydf
Copy link

iphydf commented Sep 14, 2018

no type named 'string_view' in namespace 'std'

You need to #include <string_view> somewhere.

@gregmarr
Copy link
Contributor

See #735 There are compilers that support the C++17 flag but don't have a <string_view> header in the standard library that is being used. Others have it as <experimental/string_view>, while most include it in <string> which is included, and so it gets included that way.
What compiler and standard library are you using?

@iphydf
Copy link
Author

iphydf commented Sep 14, 2018

clang-5.0 and libstdc++ from gcc 6.3.0 (__GLIBCXX__=20170516). It does not in fact seem to provide <string_view>, so including it won't fix the problem.

@nlohmann
Copy link
Owner

Could you try to include <experimental/string_view> before including json.hpp?

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Sep 16, 2018
@nlohmann
Copy link
Owner

Closing this issue as it is a duplicate of #735.

@stale
Copy link

stale bot commented Oct 17, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Oct 17, 2018
@nlohmann nlohmann removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

3 participants