mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Merge pull request #26 from Surrog/develop
Fixing visual studio compilation of string_view::at(); preserving C++11 constexpr-ness.
This commit is contained in:
commit
3e8f73c6ac
@ -121,10 +121,7 @@ namespace boost {
|
||||
BOOST_CONSTEXPR const_reference operator[](size_type pos) const BOOST_NOEXCEPT { return ptr_[pos]; }
|
||||
|
||||
BOOST_CONSTEXPR const_reference at(size_t pos) const {
|
||||
return pos >= len_ ? BOOST_THROW_EXCEPTION(std::out_of_range("boost::string_view::at")) : ptr_[pos];
|
||||
// if ( pos >= len_ )
|
||||
// BOOST_THROW_EXCEPTION( std::out_of_range ( "boost::string_view::at" ) );
|
||||
// return ptr_[pos];
|
||||
return pos >= len_ ? BOOST_THROW_EXCEPTION(std::out_of_range("boost::string_view::at")), ptr_[0] : ptr_[pos];
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR const_reference front() const { return ptr_[0]; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user