]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch by Denis Davydov: Add TableIndices::operator[] in a non-const version.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Jul 2013 18:32:38 +0000 (18:32 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Jul 2013 18:32:38 +0000 (18:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@29915 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/base/table_indices.h

index 738e2a2d44ca8610b4710edd6eccaac086bdc672..a7526a6ac39a1f2f861a934a6c30857cb0f48fe9 100644 (file)
@@ -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>
index 7ae2fb781428c311b92e23fa5b73b10276bb42e0..2bd9f24011d9707b2a272679eb98e1fd2b07be19 100644 (file)
@@ -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>

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.