#ifndef STEPPERH #define STEPPERH #include using namespace std; class stepper { const void *p; public: stepper(const void *initial_p): p(initial_p) {} stepper operator=(const void *new_p) {p = new_p; return *this;} template inline void print(const T& t) {cout << t;} static void print(unsigned char c) {cout << static_cast(c);} static void print(const char *p) {cout << "\"" << p << "\"";} template const T& stand() { cout << p << ": "; const T& t = *static_cast(p); print(t); cout << "\n"; return t; } template const T& step() { const T& t = stand(); ++reinterpret_cast(p); return t; } }; #endif