help with this classes mess...

From: Hmmm (forums_at_mail.bg)
Date: 05/30/04

  • Next message: Evil miniFAQ Boss: "FAQ: comp.lang.pascal.delphi.misc miniFAQ (short version)"
    Date: 29 May 2004 16:34:53 -0700
    
    

    I want to create a hierarchy (or something) but i fall into this
    situation:

    TA = class
      C: TC
    end;

    TB = class
      A: TA;
    end;

    TC = class
      B: TB;
    end;

    TC - the type of C field of class TA if "Undeclared identifier"
    because it is declared below declaration of class TA.
    If this was function declarations, the "forward" directive is the
    solution of this problem, but what about classes?...

    ...one solution is this
    TCParent = class
    end;

    TA = class
      C: TCParent
    end;

    TB = class
      A: TA;
    end;

    TC = class(TCParent)
      B: TB;
    end;

    ...is there anything else?


  • Next message: Evil miniFAQ Boss: "FAQ: comp.lang.pascal.delphi.misc miniFAQ (short version)"

    Relevant Pages

    • Re: Class templates and friend function templates
      ... specialised form of the operator declared in the friend declaration. ... Microsoft compilers seem to treat friend function declarations as ... Working Paper that eventually became the C++ standard. ...
      (microsoft.public.vc.language)
    • Re: More structs
      ... identifier is optional are function declarations. ... The parameter names in a function declaration are optional because the ... and so they're mandatory there. ... do without referring to the member names; ...
      (comp.lang.c)
    • Function typedef and __declspec(noreturn)
      ... The following declaration ... compiles fine with VC 7.1 but produces the following error ... function declarations or definitions ... Given that the __declspecis not standard I cannot ask ...
      (microsoft.public.vc.language)