This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

same methods shared by two interfaces in c++

Hello there,

I wanted some methods to be shared by two different interfaces. Each interface also implements methods wich are unique to it.

The methods wich are to be supposed to be the same are methods usually used to itterate though lists (SetNxt(); GetNxt() and so on).

Is there "The Way To Go" like in the sense of a design pattern? I tryed something, but i guess i´m doing it wrong.
The point is, i don´t want to build up to lists wich would have exactly the same layout, just belonging to differend interfaces. It would increase used memoryspace and messes up the code for doing the same thing twice.
I tryed something with void pointers and cast them when needed. But i guess i´m doing something wrong plus this can´t be the glory way...

Has someone an idea?

best regards,
Justus