From 06322fd510f3899f7a6c743760528333d9f28506 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 27 Jun 2018 17:24:41 +0300 Subject: 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). --- src/include/string_view.hpp | 3 ++- src/main.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 // size_t #include // 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; } -- cgit v1.2.3