]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.h
[PATCH] Make ex::operator[] const dispatch to basic::operator[] const.
[ginac.git] / ginac / ex.h
index abef5ecfb32f3a3e052a9dc54c4af5790b835271..6c9d429c7a6403e0b620a73c7ea31da0b5a9c433 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's light-weight expression handles. */
 
 /*
- *  GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2021 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ namespace GiNaC {
  *  of this class in every object file that makes use of our flyweights in
  *  order to guarantee proper initialization.  Hence we put it into this
  *  file which is included by every relevant file anyways.  This is modeled
- *  after section 27.4.2.1.6 of the C++ standard, where cout and friends are
+ *  after section [ios::Init] of the C++ standard, where cout and friends are
  *  set up.
  *
  *  @see utils.cpp */
@@ -134,8 +134,8 @@ public:
        // operand access
        size_t nops() const { return bp->nops(); }
        ex op(size_t i) const { return bp->op(i); }
-       ex operator[](const ex & index) const { return (*bp)[index]; }
-       ex operator[](size_t i) const { return (*bp)[i]; }
+       ex operator[](const ex & index) const { return (const_cast<const basic&>(*bp))[index]; }
+       ex operator[](size_t i) const { return (const_cast<const basic&>(*bp))[i]; }
        ex & let_op(size_t i);
        ex & operator[](const ex & index);
        ex & operator[](size_t i);