Allow to use string_view from std::experimental#2364
Allow to use string_view from std::experimental#2364karzhenkov wants to merge 8 commits intonlohmann:developfrom
Conversation
| env: | ||
| - COMPILER=g++-9 | ||
| - CXXFLAGS=-std=c++2a | ||
| - CXX_STANDARD=17 |
There was a problem hiding this comment.
It would be better to specify CXX_STANDARD=20, however, cmake v3.9.2 at Travis doesn't support such option. Anyway, this setting had no effect before.
|
|
||
| namespace nlohmann { | ||
| namespace std_aliases { } | ||
| using namespace std_aliases; |
There was a problem hiding this comment.
This introduces a mix of qualified and unqualified names in source code. E.g. we have std::string but string_view instead of std::string_view. We cannot introduce any names (such as std::expermental::string_view) directly into std. There is other option to consider:
namespace nlohmann {
namespace std_aliases {
using namespace std;
}
}
This allows regular qualification approach (std_aliases::string and std_aliases::string_view) but requires a lots of changes in almost all files.
clang-7 has old signature returning void
|
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. |
The support of
string_viewwas not fully tested due to problems discussed in #2213, #2241, #2117. When usingclang-7in C++17 mode thestring_viewis defined in thestd::experimentalnamespace. This results in a compile error after travis configuration is corrected.