]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/array.hpp
Don't need this.
[lyx.git] / boost / boost / array.hpp
index 21e5f1bd1b44b5a94392bc83f0eecd2f4834326c..8ef73c42508c1d465bf31d0e40bb6fc68dfad200 100644 (file)
@@ -2,13 +2,13 @@
  * an STL container (as wrapper) for arrays of constant size.
  *
  * See
- *      http://www.josuttis.com/cppcode
- * for details and the latest version.
- * See
- *      http://www.boost.org/libs/array for Documentation.
+ *      http://www.boost.org/libs/array/
  * for documentation.
  *
+ * The original author site is at: http://www.josuttis.com/
+ *
  * (C) Copyright Nicolai M. Josuttis 2001.
+ *
  * 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)
@@ -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 @@ namespace boost {
 
         // 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)
@@ -157,7 +159,7 @@ namespace boost {
         // check range (may be private because it is static)
         static void rangecheck (size_type i) {
             if (i >= size()) {
-                throw std::range_error("array<>: index out of range");
+                throw std::out_of_range("array<>: index out of range");
             }
         }
 
@@ -209,19 +211,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()
@@ -250,7 +252,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)
@@ -271,7 +273,7 @@ namespace boost {
 
         // check range (may be private because it is static)
         static reference failed_rangecheck () {
-                std::range_error e("attempt to access element of an empty array");
+                std::out_of_range e("attempt to access element of an empty array");
                 boost::throw_exception(e);
                 //
                 // We need to return something here to keep