Re: Recursive dependencies



"Tristan Van Berkom" <tvb gnome org> writes:

> 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
>>
>
> Generally in C, we'll use a common header to declare a forward
> declaration of the
> instance types:
>
> typedef _FooA FooA
> typedef _FooB FooB
>
> Then both headers of A and B classes can include
> the same header without including eachother.
>
> Cheers,
>                      -Tristan

Thanks. I even discover this header (someone else used this technique).

Regards
-- 
I've probably left my head... somewhere. Please wait untill I find it.
Homepage (pl_PL): http://uzytkownik.jogger.pl/
(GNU/)Linux User: #425935 (see http://counter.li.org/)



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