Cosmetic changes from Nico

[SVN r7880]
This commit is contained in:
Beman Dawes
2000-09-30 20:54:15 +00:00
parent 8c5daba6b3
commit b62e1aa4e7
5 changed files with 238 additions and 230 deletions

View File

@ -11,7 +11,7 @@
* This software is provided "as is" without express or implied
* warranty, and with no claim as to its suitability for any purpose.
*
* Jul 31, 2000
* Sep 29, 2000
*/
#ifndef BOOST_ARRAY_HPP
#define BOOST_ARRAY_HPP
@ -21,9 +21,7 @@
#include <iterator>
#include <algorithm>
// BUG-FIX for compilers that don't support
// std::size_t and std::ptrdiff_t yet
// (such as gcc)
// FIXES for broken compilers
#include <boost/config.hpp>
namespace boost {
@ -50,14 +48,14 @@ namespace boost {
const_iterator end() const { return elems+N; }
// reverse iterator support
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
# else
#else
// workaround for broken reverse_iterator implementations due to no partial specialization
typedef std::reverse_iterator<iterator,T> reverse_iterator;
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
# endif
#endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
@ -88,7 +86,6 @@ namespace boost {
static size_type max_size() { return N; }
enum { static_size = N };
public:
// swap (note: linear complexity)
void swap (array<T,N>& y) {
std::swap_ranges(begin(),end(),y.begin());
@ -110,10 +107,10 @@ namespace boost {
std::fill_n(begin(),size(),value);
}
# ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
#ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
private:
# endif
// private member functions are allowed in aggregates [ISO 8.5.1]
#endif
// check range (may be private because it is static)
static void rangecheck (size_type i) {
if (i >= size()) { throw std::range_error("array"); }
}