Re: Recursive dependencies



On Mon, Dec 29, 2008 at 7:52 PM, Maciej Piechotka <uzytkownik2 gmail com> wrote:
> Hello. How to handle it in the most glib-style. I have a 2 classes - A
> and B.
> A:
> - Should have a virtual method returning B
> B:
> - Should have a virtual method returning A

Your use of the term "classes" in a question about the "most
glib-style" way of doing something intrigues and confounds me.

If you're using C++, a forward declaration of a class is very simple:

class ClassName;

This construct is obviously useful for correctly parsing code with
cyclical (not quite the same as recursive!) dependencies.

On the other hand, C is what I think of when I think of "most glib
style." But that doesn't make sense either since there are no formal
classes in C, and therefore no formal language for virtual methods!

--
http://codebad.com/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]