#include #include "Cirbuf.h" int main() { Cirbuf b1; b1.produce('A'); b1.produce('B'); b1.produce('C'); char c; CirbufIterator next(b1); while ( next(c) > -1) cout << c; while ( b1.next(c) > -1) cout << c; cout << endl; c = b1.consume(); while ( b1.next(c) > -1) cout << c; cout << endl; { Cirbuf b2, b3; b2 = b1; cout << (c = b2.consume()); cout << (c = b2.consume()) << endl; c = b2.consume(); if (c > 0 ) cout << c; b3 = b2; } cout << "from b1 "; cout << (c = b1.consume()); cout << (c = b1.consume()) << endl; return(0); }