--- /dev/null
+// -*- C++ -*-
+//===--------------------------- __config ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_CONFIG
+#define _LIBCPP_EXPERIMENTAL_CONFIG
+
+#include <__config>
+
+#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace std { namespace experimental {
+#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL } }
+#define _VSTD_EXPERIMENTAL std::experimental
+
+#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
+#define _LIBCPP_END_NAMESPACE_LFTS } } }
+#define _VSTD_LFTS _VSTD_EXPERIMENTAL::fundamentals_v1
+
+#endif
*/
-#include <__config>
+#include <experimental/__config>
#include <string>
#include <algorithm>
#pragma GCC system_header
#endif
-namespace std {
- namespace experimental {
- inline namespace library_fundamentals_v1 {
+_LIBCPP_BEGIN_NAMESPACE_LFTS
template<class _CharT, class _Traits = _VSTD::char_traits<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY basic_string_view {
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __pos) const { return __data[__pos]; }
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference at(size_type __pos) const
{
- if (__pos >= size())
- throw out_of_range("string_view::at");
- return __data[__pos];
+ return __pos >= size()
+ ? throw out_of_range("string_view::at")
+ : __data[__pos];
+// if (__pos >= size())
+// throw out_of_range("string_view::at");
+// return __data[__pos];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
return __rlen;
}
- _LIBCPP_CONSTEXPR basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
+ _LIBCPP_CONSTEXPR
+ basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
{
// if (__pos > size())
// throw out_of_range("string_view::substr");
typedef basic_string_view<char32_t> u32string_view;
typedef basic_string_view<wchar_t> wstring_view;
-}}} // close std::experimental::library_fundamentals_v1
-
+_LIBCPP_END_NAMESPACE_LFTS
_LIBCPP_BEGIN_NAMESPACE_STD
// [string.view.hash]