Skip to content

Compile error in clang 5.0 #782

Closed
Closed
@DronCode

Description

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 :)

Metadata

Assignees

No one assigned

    Labels

    solution: duplicatethe issue is a duplicate; refer to the linked issue instead

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions