|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53198 - in branches/release: boost libs/array/test
From: steven_at_[hidden]
Date: 2009-05-23 02:00:43
Author: steven_watanabe
Date: 2009-05-23 02:00:42 EDT (Sat, 23 May 2009)
New Revision: 53198
URL: http://svn.boost.org/trac/boost/changeset/53198
Log:
Merge [53104] and [53105] from the trunk
Text files modified:
branches/release/boost/array.hpp | 14 ++++++++------
branches/release/libs/array/test/array3.cpp | 2 +-
branches/release/libs/array/test/array5.cpp | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
Modified: branches/release/boost/array.hpp
==============================================================================
--- branches/release/boost/array.hpp (original)
+++ branches/release/boost/array.hpp 2009-05-23 02:00:42 EDT (Sat, 23 May 2009)
@@ -27,6 +27,7 @@
#include <cstddef>
#include <stdexcept>
#include <boost/assert.hpp>
+#include <boost/swap.hpp>
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
@@ -131,7 +132,8 @@
// swap (note: linear complexity)
void swap (array<T,N>& y) {
- std::swap_ranges(begin(),end(),y.begin());
+ for (size_type i = 0; i < N; ++i)
+ boost::swap(elems[i],y.elems[i]);
}
// direct access to data (read-only)
@@ -209,19 +211,19 @@
}
// 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()
@@ -250,7 +252,7 @@
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)
Modified: branches/release/libs/array/test/array3.cpp
==============================================================================
--- branches/release/libs/array/test/array3.cpp (original)
+++ branches/release/libs/array/test/array3.cpp 2009-05-23 02:00:42 EDT (Sat, 23 May 2009)
@@ -21,7 +21,7 @@
// copy and change order
boost::array<std::string,4> seasons_orig = seasons;
- for (unsigned i=seasons.size()-1; i>0; --i) {
+ for (std::size_t i=seasons.size()-1; i>0; --i) {
std::swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
}
Modified: branches/release/libs/array/test/array5.cpp
==============================================================================
--- branches/release/libs/array/test/array5.cpp (original)
+++ branches/release/libs/array/test/array5.cpp 2009-05-23 02:00:42 EDT (Sat, 23 May 2009)
@@ -27,7 +27,7 @@
typedef boost::array<float,6> Array;
// create and initialize an array
- const Array a = { { 42.42 } };
+ const Array a = { { 42.42f } };
// use some common STL container operations
std::cout << "static_size: " << a.size() << std::endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk