
I used the "raw"-tag to quote the code. Here is it again without the tags: ... So, code like boost::array<int,2> test; test[2] = 1; test[-1] = 1; compiles without warnings or erros. Now, adding the following functions to array template<size_type i> reference at() { BOOST_STATIC_ASSERT( (i < N) ); return elems[i]; } template<size_type i> const_reference at() const { BOOST_STATIC_ASSERT( (i < N) ); return elems[i]; } would make it possible to write boost::array<int,2> test; test.at<2> = 1; test.at<-1> = 1; which results in the expected error messages. -- View this message in context: http://boost.2283326.n4.nabble.com/array-compile-time-checked-access-tp46381... Sent from the Boost - Dev mailing list archive at Nabble.com.