mirror of
https://github.com/boostorg/array.git
synced 2025-07-29 12:17:40 +02:00
Fix off-by-one error in range-checking for 'at()'. thanks to DHilbrich for the bug report.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user