Compare commits

..

10 Commits

Author SHA1 Message Date
bcbf9de9ed Created a branch from trunk
[SVN r38959]
2007-08-26 05:34:35 +00:00
069b5e2ca1 Throw out_of_range rather than range_error. See 21.1.1 paragraph 13.
[SVN r36304]
2006-12-08 16:54:30 +00:00
526953fc5e Test for out_of_range rather than range_error. See 21.1.1 paragraph 13.
[SVN r36303]
2006-12-08 16:53:49 +00:00
b06f12b0b7 Fixed license & copyright issues.
[SVN r36224]
2006-12-01 10:29:49 +00:00
f0bbb8b211 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
d7a5408143 http://www.josuttis.com/ hasn't the latest version any more
[SVN r34855]
2006-08-08 18:49:30 +00:00
564e4029d0 Simplified code.
[SVN r34384]
2006-06-24 11:31:19 +00:00
0dc11c2f23 Fix compiler errors resulting from missing return values.
[SVN r34259]
2006-06-09 11:40:07 +00:00
7da1c4b310 Remove size zero support for old compilers that do not support partial template specialization
[SVN r34161]
2006-06-04 11:01:59 +00:00
8f10fdf27e Support for zero length arrays
[SVN r34154]
2006-06-03 12:51:13 +00:00
12 changed files with 8 additions and 66 deletions

View File

@ -1,27 +0,0 @@
#
# Copyright Troy D. Straszheim
#
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
#
#----------------------------------------------------------------------------
# This file was automatically generated from the original CMakeLists.txt file
# Add a variable to hold the headers for the library
set (lib_headers
array.hpp
)
# Add a library target to the build system
boost_library_project(
array
# SRCDIRS
TESTDIRS test
HEADERS ${lib_headers}
# DOCDIRS
DESCRIPTION "STL compliant container wrapper for arrays of constant size."
MODULARIZED
AUTHORS "Nicolai Josuttis"
# MAINTAINERS
)

View File

@ -21,7 +21,7 @@ int main()
// copy and change order
boost::array<std::string,4> seasons_orig = seasons;
for (std::size_t i=seasons.size()-1; i>0; --i) {
for (unsigned i=seasons.size()-1; i>0; --i) {
std::swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
}

View File

@ -27,7 +27,7 @@ int main()
typedef boost::array<float,6> Array;
// create and initialize an array
const Array a = { { 42.42f } };
const Array a = { { 42.42 } };
// use some common STL container operations
std::cout << "static_size: " << a.size() << std::endl;

View File

@ -27,7 +27,6 @@
#include <cstddef>
#include <stdexcept>
#include <boost/assert.hpp>
#include <boost/swap.hpp>
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
@ -132,8 +131,7 @@ namespace boost {
// swap (note: linear complexity)
void swap (array<T,N>& y) {
for (size_type i = 0; i < N; ++i)
boost::swap(elems[i],y.elems[i]);
std::swap_ranges(begin(),end(),y.begin());
}
// direct access to data (read-only)
@ -211,19 +209,19 @@ namespace boost {
}
// operator[]
reference operator[](size_type /*i*/)
reference operator[](size_type i)
{
return failed_rangecheck();
}
const_reference operator[](size_type /*i*/) const
const_reference operator[](size_type i) const
{
return failed_rangecheck();
}
// at() with range check
reference at(size_type /*i*/) { return failed_rangecheck(); }
const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
reference at(size_type i) { return failed_rangecheck(); }
const_reference at(size_type i) const { return failed_rangecheck(); }
// front() and back()
reference front()
@ -252,7 +250,7 @@ namespace boost {
static size_type max_size() { return 0; }
enum { static_size = 0 };
void swap (array<T,0>& /*y*/) {
void swap (array<T,0>& y) {
}
// direct access to data (read-only)

View File

@ -1 +0,0 @@
boost_module(array DEPENDS utility)

View File

@ -1,14 +0,0 @@
#
# Copyright Troy D. Straszheim
#
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
#
boost_additional_test_dependencies(array BOOST_DEPENDS test)
boost_test_run(array0 array0.cpp)
boost_test_run(array1 array1.cpp)
boost_test_run(array2 array2.cpp)
boost_test_run(array3 array3.cpp)
boost_test_run(array4 array4.cpp)
boost_test_run(array5 array5.cpp)

View File

@ -1,14 +0,0 @@
#~ 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 ]
;