mirror of
https://github.com/boostorg/array.git
synced 2025-06-26 12:31:41 +02:00
Compare commits
4 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
47ef0218de | |||
992299f2bf | |||
e6a44cf529 | |||
111e93aa4c |
@ -118,13 +118,13 @@ namespace boost {
|
||||
// operator[]
|
||||
reference operator[](size_type i)
|
||||
{
|
||||
BOOST_ASSERT( i < N && "out of range" );
|
||||
BOOST_ASSERT_MSG( i < N, "out of range" );
|
||||
return elems[i];
|
||||
}
|
||||
|
||||
const_reference operator[](size_type i) const
|
||||
{
|
||||
BOOST_ASSERT( i < N && "out of range" );
|
||||
BOOST_ASSERT_MSG( i < N, "out of range" );
|
||||
return elems[i];
|
||||
}
|
||||
|
||||
|
@ -15,12 +15,11 @@
|
||||
#include <boost/array.hpp>
|
||||
#include "print.hpp"
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create and initialize array
|
||||
array<int,10> a = { { 1, 2, 3, 4, 5 } };
|
||||
boost::array<int,10> a = { { 1, 2, 3, 4, 5 } };
|
||||
|
||||
print_elements(a);
|
||||
|
||||
|
Reference in New Issue
Block a user