From 183338fd463e3a45cb39abf237d0c313245ef2db Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@math.tamu.edu>
Date: Tue, 2 Jul 2013 18:32:38 +0000
Subject: [PATCH] Patch by Denis Davydov: Add TableIndices::operator[] in a
 non-const version.

git-svn-id: https://svn.dealii.org/trunk@29915 0785d39b-7218-0410-832d-ea1e28bc413d
---
 deal.II/doc/news/changes.h                   |  5 +++++
 deal.II/include/deal.II/base/table_indices.h | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index 738e2a2d44..a7526a6ac3 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -147,6 +147,11 @@ this function.
 
 <ol>
 
+<li> New: There is now a read-write version of TableIndices::operator[].
+<br>
+(Denis Davydov, 2013/07/02)
+</li>
+
 <li> New: The function parallel::distributed::Triangulation::copy_triangulation() is
 now implemented.
 <br>
diff --git a/deal.II/include/deal.II/base/table_indices.h b/deal.II/include/deal.II/base/table_indices.h
index 7ae2fb7814..2bd9f24011 100644
--- a/deal.II/include/deal.II/base/table_indices.h
+++ b/deal.II/include/deal.II/base/table_indices.h
@@ -41,6 +41,12 @@ public:
    * <tt>i</tt>th index.
    */
   unsigned int operator[] (const unsigned int i) const;
+  
+  /**
+   * Write access the value of the
+   * <tt>i</tt>th index.
+   */
+  unsigned int & operator[] (const unsigned int i);
 
   /**
    * Compare two index fields for
@@ -424,6 +430,14 @@ TableIndicesBase<N>::operator [] (const unsigned int i) const
   return indices[i];
 }
 
+template <int N>
+inline
+unsigned int &
+TableIndicesBase<N>::operator [] (const unsigned int i) 
+{
+  Assert (i < N, ExcIndexRange (i, 0, N));
+  return indices[i];
+}
 
 
 template <int N>
-- 
2.39.5