diff options
author | Greg V <greg@unrelenting.technology> | 2018-06-27 17:24:41 +0300 |
---|---|---|
committer | Greg V <greg@unrelenting.technology> | 2018-06-27 17:24:41 +0300 |
commit | 06322fd510f3899f7a6c743760528333d9f28506 (patch) | |
tree | f911a7a02b17a9cf6ea4b30d98157336249f96b5 /src | |
parent | b03d61ed130dad6fa88a3beb4c32e48f86fdf84e (diff) | |
download | mrust-06322fd510f3899f7a6c743760528333d9f28506.tar.gz |
Move src/include/string_view.hpp into own namespace
libc++ offers std::string_view regardless of -std flag, so defining
a custom std::string_view results in a conflict.
This one is actually not a precise clone of the real one (uses two
pointers instead of pointer+length).
Diffstat (limited to 'src')
-rw-r--r-- | src/include/string_view.hpp | 3 | ||||
-rw-r--r-- | src/main.cpp | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/include/string_view.hpp b/src/include/string_view.hpp index 7d049e9e..a0cf596b 100644 --- a/src/include/string_view.hpp +++ b/src/include/string_view.hpp @@ -10,7 +10,8 @@ #include <cstddef> // size_t #include <iostream> // ostream -namespace std { +namespace stdx { +using namespace std; class string_view { diff --git a/src/main.cpp b/src/main.cpp index 75c078ee..8f2740fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1077,14 +1077,14 @@ ProgramParams::ProgramParams(int argc, char *argv[]) { const char* end = strchr(a, ':'); - ::std::string_view s; + ::stdx::string_view s; if( end ) { - s = ::std::string_view { a, end }; + s = ::stdx::string_view { a, end }; a = end + 1; } else { end = a + strlen(a); - s = ::std::string_view { a, end }; + s = ::stdx::string_view { a, end }; a = end; } |