json: Compilation Error on Clang 5.0 Upgrade

Upgrading to Clang+±5.0 on Travis-CI Trusty is producing the following error:


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

Also tested on Ubuntu 16.04 Clang+±5.0 standalone without the rest of the project and still failing with the same error. g++ working fine on both systems.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 25 (18 by maintainers)

Commits related to this issue

Most upvoted comments

One workaround (though quite brittle), would be:

// FixedJson.hpp (your header)
#include <experimental/string_view>
#include <json.hpp>

Then you include this file instead of including json.hpp directly. Of course once your distribution ships a library with C++17 support, you will not need that workaround anymore.

Could we use the __has_include feature to detect that?