* Interface to GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2023 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
* 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 */
// 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);
// Iterators
-class const_iterator : public std::iterator<std::random_access_iterator_tag, ex, ptrdiff_t, const ex *, const ex &> {
+class const_iterator {
friend class ex;
friend class const_preorder_iterator;
friend class const_postorder_iterator;
-
public:
+ using iterator_category = std::random_access_iterator_tag;
+ using value_type = ex;
+ using difference_type = ptrdiff_t;
+ using pointer = const ex *;
+ using reference = const ex &;
+
const_iterator() noexcept {}
private:
} // namespace internal
-class const_preorder_iterator : public std::iterator<std::forward_iterator_tag, ex, ptrdiff_t, const ex *, const ex &> {
+class const_preorder_iterator {
public:
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = ex;
+ using difference_type = ptrdiff_t;
+ using pointer = const ex *;
+ using reference = const ex &;
const_preorder_iterator() noexcept {}
const_preorder_iterator(const ex &e, size_t n)
}
};
-class const_postorder_iterator : public std::iterator<std::forward_iterator_tag, ex, ptrdiff_t, const ex *, const ex &> {
+class const_postorder_iterator {
public:
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = ex;
+ using difference_type = ptrdiff_t;
+ using pointer = const ex *;
+ using reference = const ex &;
const_postorder_iterator() noexcept {}
const_postorder_iterator(const ex &e, size_t n)