dex wrote:
hi,
i am just trying to implement Iterator pattern in C++, I just stuck up
with how to use interfaces,
Please help me in how to use interfaces in C++,
Can i use abstract base class instead of interfaces?
More precisely, you can use multiple inheritance in C++ in much the
same way that interfaces are used in Java. The idea would be to declare
an abstract base class (or non-abstract class when following the
non-virtual interface (NVI) design pattern). Then simply have classes
conforming to the "interface" inherit from the class designed in the
previous step, regardless of any other classes they may also inherit
from. (hmmm...I wonder if I could have made that last sentence any
longer...)
Greg