]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add patch for range checking of std::vector[]
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 12 Mar 2006 20:09:50 +0000 (20:09 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 12 Mar 2006 20:09:50 +0000 (20:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@12577 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch [new file with mode: 0644]

diff --git a/deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch b/deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch
new file mode 100644 (file)
index 0000000..8f6b321
--- /dev/null
@@ -0,0 +1,46 @@
+*** stl_vector.h       2005-10-17 18:15:32.000000000 +0200
+--- stl_vector.orig.h  2005-10-10 21:30:22.000000000 +0200
+***************
+*** 492,503 ****
+         */
+        reference
+        operator[](size_type __n)
+!       {
+! #ifdef STL_DEBUG
+!      if (__n >= this->size()) abort();
+! #endif
+!      return *(begin() + __n);
+!       }
+  
+        /**
+         *  @brief  Subscript access to the data contained in the %vector.
+--- 492,498 ----
+         */
+        reference
+        operator[](size_type __n)
+!       { return *(begin() + __n); }
+  
+        /**
+         *  @brief  Subscript access to the data contained in the %vector.
+***************
+*** 512,523 ****
+         */
+        const_reference
+        operator[](size_type __n) const
+!       {
+! #ifdef STL_DEBUG
+!      if (__n >= this->size()) abort();
+! #endif
+!      return *(begin() + __n);
+!       }
+  
+      protected:
+        /// @if maint Safety check used only from at().  @endif
+--- 507,513 ----
+         */
+        const_reference
+        operator[](size_type __n) const
+!       { return *(begin() + __n); }
+  
+      protected:
+        /// @if maint Safety check used only from at().  @endif

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.