From ca907a03287c1a8b49ce7aff87c77414a1167c1d Mon Sep 17 00:00:00 2001 From: bangerth 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.
    +
  1. New: There is now a read-write version of TableIndices::operator[]. +
    +(Denis Davydov, 2013/07/02) +
  2. +
  3. New: The function parallel::distributed::Triangulation::copy_triangulation() is now implemented.
    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: * ith index. */ unsigned int operator[] (const unsigned int i) const; + + /** + * Write access the value of the + * ith index. + */ + unsigned int & operator[] (const unsigned int i); /** * Compare two index fields for @@ -424,6 +430,14 @@ TableIndicesBase::operator [] (const unsigned int i) const return indices[i]; } +template +inline +unsigned int & +TableIndicesBase::operator [] (const unsigned int i) +{ + Assert (i < N, ExcIndexRange (i, 0, N)); + return indices[i]; +} template -- 2.39.5