x::ref and x::ptrtypedef x::refiterator<customiteratorObj> customiterator; // ... customiterator iter=customiterator::create(); // ... iter.get()->method();
An x::refiterator overrides the
*() and ->() operators to
implement them as iterator operators; essentially hiding
the underlying reference-counted object, replacing it with
an iterated-over sequence. If needed,
get() returns the underlying
x::ref or a x::ptr, to access the underlying reference-counted object.