summaryrefslogtreecommitdiff
path: root/include/experimental/string_view
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
commit61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch)
treeec41ed70ffca97240e76f9a78bb2dedba28f310c /include/experimental/string_view
parentf857581820d15e410e9945d2fcd5f7163be25a96 (diff)
downloadsrc-test2-61b9a7258a7693d7f3674a5a1daf7b036ff1d382.tar.gz
src-test2-61b9a7258a7693d7f3674a5a1daf7b036ff1d382.zip
Notes
Diffstat (limited to 'include/experimental/string_view')
-rw-r--r--include/experimental/string_view9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/experimental/string_view b/include/experimental/string_view
index d423f39003a5..2a20d7caa687 100644
--- a/include/experimental/string_view
+++ b/include/experimental/string_view
@@ -280,11 +280,8 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
const_reference at(size_type __pos) const
{
return __pos >= size()
- ? throw out_of_range("string_view::at")
+ ? (throw out_of_range("string_view::at"), __data[0])
: __data[__pos];
-// if (__pos >= size())
-// throw out_of_range("string_view::at");
-// return __data[__pos];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
@@ -313,7 +310,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
void remove_prefix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(n <= size(), "remove_prefix() can't remove more than size()");
+ _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
__data += __n;
__size -= __n;
}
@@ -321,7 +318,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
void remove_suffix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(n <= size(), "remove_suffix() can't remove more than size()");
+ _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
__size -= __n;
}