class receiverObj : public x::outputrefiteratorObj<int> { // ... void operator=(int c) override; }; outputrefiterator<int> iter=x::refiterator<receiverObj>::create();
x::outputrefiteratorObj
defines shims for an output iterator over the class given as a template
parameter. x::outputrefiteratorObj
defines
the operator++
() and operator*
()
shims, and a virtual operator=
() which gets
defined in a subclass.
x::outputrefiterator<
defines a reference-counted iterator to an
T
>x::outputrefiteratorObj<
.
There's also an
T
>x::outputrefiteratorptr<
;
as well as
T
>x::const_outputrefiterator<
and
T
>x::const_outputrefiteratorptr<
(marginally useful, since
T
>x::outputrefiteratorObj<
does not have any T
>const
methods).
This allows non template-based implementations based on
x::outputrefiterator<
to operate on any reference-counted output iterator implemented by a
T
>x::outputrefiteratorObj<
subclass, with the trade-off of less-optimized code that uses
virtual function calls, in place of potential optimizations involving
iterating of the assignment operator.
T
>