Corrected argument type in string_view/ref::at().

This commit is contained in:
Andrey Semashev 2022-05-03 00:23:10 +03:00
parent fe417f6237
commit eb29d71245
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ namespace boost {
// element access
BOOST_CONSTEXPR const charT& operator[](size_type pos) const { return ptr_[pos]; }
const charT& at(size_t pos) const {
const charT& at(size_type pos) const {
if ( pos >= len_ )
BOOST_THROW_EXCEPTION( std::out_of_range ( "boost::string_ref::at" ) );
return ptr_[pos];

View File

@ -128,7 +128,7 @@ namespace boost {
// element access
BOOST_CONSTEXPR const_reference operator[](size_type pos) const BOOST_NOEXCEPT { return ptr_[pos]; }
BOOST_CONSTEXPR const_reference at(size_t pos) const {
BOOST_CONSTEXPR const_reference at(size_type pos) const {
return pos >= len_ ? BOOST_THROW_EXCEPTION(std::out_of_range("boost::string_view::at")), ptr_[0] : ptr_[pos];
}