mirror of
https://github.com/boostorg/array.git
synced 2025-06-26 20:41:36 +02:00
Compare commits
11 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
e24d329c11 | |||
9804292dad | |||
069b5e2ca1 | |||
526953fc5e | |||
b06f12b0b7 | |||
f0bbb8b211 | |||
d7a5408143 | |||
564e4029d0 | |||
0dc11c2f23 | |||
7da1c4b310 | |||
8f10fdf27e |
@ -157,7 +157,7 @@ namespace boost {
|
|||||||
// check range (may be private because it is static)
|
// check range (may be private because it is static)
|
||||||
static void rangecheck (size_type i) {
|
static void rangecheck (size_type i) {
|
||||||
if (i >= size()) {
|
if (i >= size()) {
|
||||||
throw std::range_error("array<>: index out of range");
|
throw std::out_of_range("array<>: index out of range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ namespace boost {
|
|||||||
|
|
||||||
// check range (may be private because it is static)
|
// check range (may be private because it is static)
|
||||||
static reference failed_rangecheck () {
|
static reference failed_rangecheck () {
|
||||||
std::range_error e("attempt to access element of an empty array");
|
std::out_of_range e("attempt to access element of an empty array");
|
||||||
boost::throw_exception(e);
|
boost::throw_exception(e);
|
||||||
//
|
//
|
||||||
// We need to return something here to keep
|
// We need to return something here to keep
|
||||||
|
14
test/Jamfile.v2
Normal file
14
test/Jamfile.v2
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#~ Copyright Rene Rivera 2008
|
||||||
|
#~ Distributed under the Boost Software License, Version 1.0.
|
||||||
|
#~ (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
import testing ;
|
||||||
|
|
||||||
|
test-suite array :
|
||||||
|
[ run array0.cpp ]
|
||||||
|
[ run array1.cpp ]
|
||||||
|
[ run array2.cpp ]
|
||||||
|
[ run array3.cpp ]
|
||||||
|
[ run array4.cpp ]
|
||||||
|
[ run array5.cpp ]
|
||||||
|
;
|
@ -85,12 +85,12 @@ void RunTests()
|
|||||||
// Confirm at() throws the std lib defined exception
|
// Confirm at() throws the std lib defined exception
|
||||||
try {
|
try {
|
||||||
BadValue( test_case.at( 0 ) );
|
BadValue( test_case.at( 0 ) );
|
||||||
} catch ( const std::range_error & ) {
|
} catch ( const std::out_of_range & ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BadValue( const_test_case.at( 0 ) );
|
BadValue( const_test_case.at( 0 ) );
|
||||||
} catch ( const std::range_error & ) {
|
} catch ( const std::out_of_range & ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user