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

Compile error in clang 5.0 #782

Closed
DronCode opened this issue Oct 14, 2017 · 2 comments
Closed

Compile error in clang 5.0 #782

DronCode opened this issue Oct 14, 2017 · 2 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@DronCode
Copy link

DronCode commented Oct 14, 2017

Hi.
In clang 5.0 I have an compile error:

json.hpp:9830:66: error: no type named 'string_view' in namespace std' and not std::is_same<ValueType, typename std::string_view>::value

I've found temporary solution (paste it after includes):

#if ((defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_MSC_VER) && _MSC_VER >1900 && defined(_HAS_CXX17) && _HAS_CXX17 == 1)) && defined(__clang__)
#include <experimental/string_view>
namespace std {
    using string_view = std::experimental::string_view;
}
#endif

May be already created another better solution?
It can be helpful for people like me, who wants to get C++17 in clang :)

P.S. Sorry for my English :)

@nlohmann
Copy link
Owner

Duplicates #735

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Oct 14, 2017
@nlohmann
Copy link
Owner

Thanks for reporting and sharing your solution. We shall see if we can integrate this with the proposal in #735.

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

2 participants