-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Allow to use string_view from std::experimental #2364
Conversation
@@ -222,7 +222,7 @@ matrix: | |||
compiler: gcc | |||
env: | |||
- COMPILER=g++-9 | |||
- CXXFLAGS=-std=c++2a | |||
- CXX_STANDARD=17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -2048,6 +2048,25 @@ JSON_HEDLEY_DIAGNOSTIC_POP | |||
#define JSON_HAS_CPP_14 | |||
#endif | |||
|
|||
namespace nlohmann { | |||
namespace std_aliases { } | |||
using namespace std_aliases; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_view
was not fully tested due to problems discussed in #2213, #2241, #2117. When usingclang-7
in C++17 mode thestring_view
is defined in thestd::experimental
namespace. This results in a compile error after travis configuration is corrected.