aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstdc++-v3/include/experimental/string_view9
-rw-r--r--libstdc++-v3/include/std/string_view9
2 files changed, 6 insertions, 12 deletions
diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view
index 629db57..5567184 100644
--- a/libstdc++-v3/include/experimental/string_view
+++ b/libstdc++-v3/include/experimental/string_view
@@ -179,8 +179,7 @@ inline namespace fundamentals_v1
constexpr const _CharT&
operator[](size_type __pos) const
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(__pos < this->_M_len);
+ __glibcxx_assert(__pos < this->_M_len);
return *(this->_M_str + __pos);
}
@@ -199,16 +198,14 @@ inline namespace fundamentals_v1
constexpr const _CharT&
front() const
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(this->_M_len > 0);
+ __glibcxx_assert(this->_M_len > 0);
return *this->_M_str;
}
constexpr const _CharT&
back() const
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(this->_M_len > 0);
+ __glibcxx_assert(this->_M_len > 0);
return *(this->_M_str + this->_M_len - 1);
}
diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view
index ca0d6265..f05ff32 100644
--- a/libstdc++-v3/include/std/string_view
+++ b/libstdc++-v3/include/std/string_view
@@ -207,8 +207,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr const_reference
operator[](size_type __pos) const noexcept
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(__pos < this->_M_len);
+ __glibcxx_assert(__pos < this->_M_len);
return *(this->_M_str + __pos);
}
@@ -225,16 +224,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr const_reference
front() const noexcept
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(this->_M_len > 0);
+ __glibcxx_assert(this->_M_len > 0);
return *this->_M_str;
}
constexpr const_reference
back() const noexcept
{
- // TODO: Assert to restore in a way compatible with the constexpr.
- // __glibcxx_assert(this->_M_len > 0);
+ __glibcxx_assert(this->_M_len > 0);
return *(this->_M_str + this->_M_len - 1);
}