Custom list implementation iterator can't access last element (c++) : <p>I'm implementing a custom list for a personal project &amp; I can't seem to access the last element with an iterator.</p>

<p>It's basically a flat doubly linked list (with next &amp; previous node pointers). </p>

<p><strong>expression.hpp</strong></p>

<pre><code>#ifndef TPP_EXPRESSION_HPP
#define TPP_EXPRESSION_HPP

#include &lt;cstddef&gt;
#include &lt;globals.hpp&gt;
#include "node.hpp"
#include "iterator.hpp"
#include &lt;iostream&gt;

namespace tpp {
namespace expression {
class Expression {
    std::size_t _size;
    Node* left;
    Node* right;

public:
    void print() {
        Node* node = left;
        while (node != nullptr) {
            std::cout &lt;&lt; node-&gt;value &lt;&lt; "\t";
            node = node-&gt;next;
        }
    }

    void append(byte val) {
        Node* node = new Node(val);
        if (right != nullptr) {
            Node* tmp = right;
            tmp-&gt;next = node;
            right = node;
            right-&gt;prev = tmp;
        } else {
            left = right = node;
        }
        _size++;
    }

    Iterator begin() {
        std::cout &lt;&lt; "Left: " &lt;&lt; left-&gt;value &lt;&lt; std::endl;
        return Iterator(left);
    }

    const ConstIterator cbegin() const {
        return ConstIterator(left);
    }

    Iterator end() {
        std::cout &lt;&lt; "Right: " &lt;&lt; right-&gt;value &lt;&lt; std::endl;
        return Iterator(right);
    }

    const ConstIterator cend() const {
        return ConstIterator(right);
    }

    bool is_empty() {
        return _size == 0;
    }

    std::size_t size() {
        return _size;
    }

    Expression() : _size(0), left(nullptr), right(nullptr) {
    }

    ~Expression() {
        Node* node = right;
        while (node != nullptr) {
            Node* old_back = node;
            node = node-&gt;prev;
            delete old_back;
        }
        left = nullptr;
        right = nullptr;
    }
};
} // expression
} // tpp
#endif //TPP_EXPRESSION_HPP
</code></pre>

<p><strong>iterator.hpp</strong></p>

<pre><code>#ifndef TPP_EXPRESSION_ITERATOR_HPP
#define TPP_EXPRESSION_ITERATOR_HPP

#include &lt;globals.hpp&gt;
#include "node.hpp"
#include &lt;iostream&gt;

namespace tpp {
namespace expression {

class Iterator {
    Node* node;
public:
    Iterator(Node* ptr) : node(ptr) {}
    Iterator(const Iterator&amp; rhs) : node(rhs.node) {}
    Iterator&amp; operator++() { std::cout &lt;&lt; "Current: " &lt;&lt; node-&gt;value &lt;&lt; std::endl; node = node-&gt;next; std::cout &lt;&lt; "Now: " &lt;&lt; node-&gt;value &lt;&lt; std::endl;return *this; }
    Iterator&amp; operator--() { node = node-&gt;prev; return *this; }
    bool operator!=(const Iterator&amp; rhs) { bool stats = node != rhs.node; std::cout &lt;&lt; (stats ? "Not equal" : "Equal") &lt;&lt; std::endl;  return stats; }
    bool operator==(const Iterator&amp; rhs) { return node == rhs.node; }
    byte&amp; operator*() { std::cout &lt;&lt; "Dereferencing " &lt;&lt; node-&gt;value &lt;&lt; std::endl; return node-&gt;value; }
};

class ConstIterator {
    const Node* node;
public:
    ConstIterator(const Node* ptr) : node(ptr) {}
    ConstIterator(const ConstIterator&amp; rhs) : node(rhs.node) {}
    ConstIterator&amp; operator++() { node = node-&gt;next; return *this; }
    ConstIterator&amp; operator--() { node = node-&gt;prev; return *this; }
    bool operator!=(const ConstIterator&amp; rhs) { return node != rhs.node; }
    bool operator==(const ConstIterator&amp; rhs) { return node == rhs.node; }
    const byte&amp; operator*() const { return node-&gt;value; }
};
} // expression
} // tpp
#endif //TPP_EXPRESSION_ITERATOR_HPP
</code></pre>

<p><strong>node.hpp</strong></p>

<pre><code>#ifndef TPP_EXPRESSION_NODE_HPP
#define TPP_EXPRESSION_NODE_HPP
#include &lt;globals.hpp&gt;

namespace tpp {
namespace expression {
struct Node {
    Node* prev;
    Node* next;
    byte value;
    Node(byte value) : value(value), prev(nullptr), next(nullptr) {}
    Node() : value('\0'), prev(nullptr), next(nullptr) {}
};
}
} // tpp
#endif //TPP_EXPRESSION_NODE_HPP
</code></pre>

<p><strong>main.cpp</strong></p>

<pre><code>#include &lt;iostream&gt;
#include &lt;globals.hpp&gt;
#include &lt;expression/include.hpp&gt;

using namespace std;

int main()
{
    tpp::expression::Expression e;
    e.append('0');
    e.append('1');
    e.append('0');
    e.append('1');
    for (auto elem : e) {
        std::cout &lt;&lt; elem &lt;&lt; std::endl;
    }
    e.print();
}
</code></pre>

<p><strong>Example output</strong></p>

<pre><code>Left: 0
Right: 1
Not equal
Dereferencing 0
0
Current: 0
Now: 1
Not equal
Dereferencing 1
1
Current: 1
Now: 0
Not equal
Dereferencing 0
0
Current: 0
Now: 1
Equal
0       1       0       1
</code></pre>

<p>Code is a mess, I was more focused on getting it working before I cleaned it up. Any help would be useful, thanks.</p>
