Fix off-by-one error in range-checking for 'at()'. thanks to DHilbrich for the bug report.

This commit is contained in:
Marshall Clow
2019-02-07 07:52:11 -08:00
parent 854215e54c
commit b279a9005b
2 changed files with 20 additions and 1 deletions

View File

@ -183,7 +183,7 @@ namespace boost {
// check range (may be private because it is static)
static BOOST_CONSTEXPR bool rangecheck (size_type i) {
return i > size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true;
return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true;
}
};