04/01/16 18:20
>>80
すぐ考え付くのは、
template <class T> my_iterator {
private:
T * currrent;
struct T_ref {
T_ref(T &r) : ref(r){}
operator T() {return ref + 1;}
template <typename U>
T_ref &operator=(const U &u) {ref = u; return *this;}
T &ref;
};
public:
T &operator*() {return T_ref(*current);}
};
色々問題がありそうだが。