#include <iostream>
#include <cassert>
#include <vector>
#include <type_traits>
using namespace std;
 
template<class C>
struct Iterator{
    operator bool() const{
        return startiterator != enditerator;
    }
    const Iterator &operator ++(){
        assert(*this);
        startiterator++;
        return *this;
    }
    const Iterator operator ++(int){
        Iterator other(*this);
        startiterator++;
        return other;
    }
    typename C::iterator startiterator, enditerator;
    //typename C::iterator sollte durch decltype(C::begin()) oder so ersetz werden
    Iterator(C &c) : startiterator(c.begin()), enditerator(c.end()){
    }
 
    auto operator *() -> decltype(*startiterator){
        //hier muss man noch was mit add_const und add_rvalue_reference machen
        return *startiterator;
    }
};
 
//Am ende den ganzen Spaß nochmal für const-Iterator
 
int main(){
    vector<int> v = {42, 37, 128};
    Iterator<vector<int>> it(v); //kann man noch in eine makeIterator-Funktion tun
    while (it){
        cout << *it << ' ';
        it++;
    }
}