Re: Managed code, .H and .CPP
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 07:06:53 -0800
Ignazio wrote:
> Thank you. If I understood well, I can write all the code of the
> forms in their .H without any problem.
> The only problem is with cross-dependance of two classes. For example:
>
> // A.h
> #include "B.h"
>
> ref class A {
> void f () {
> B::g();
> }
> void g () {
> Console::WriteLine("test");
> }
> };
>
> // B.h
> #include "A.h"
> ref class B {
> void g() {
> A::g();
> }
> };
>
> The compiler encounters an error, as it is right to do in C++. So, it
> is necessary to write a header and a cpp file for one of the two
> classes... Don't you find it a little tricky that I need just the .H
> for some files and both for other files?
Yep.
You can thank C++'s one-pass compilation model for that. Until (and unless)
C++ adopts a multi-pass compilation model we'll always have that limitation.
-cd
.
- References:
- Re: Managed code, .H and .CPP
- From: Carl Daniel [VC++ MVP]
- Re: Managed code, .H and .CPP
- Prev by Date: Re: probing for CLR
- Next by Date: Re: Endless Loop in C-Code when Using /Og
- Previous by thread: Re: Managed code, .H and .CPP
- Next by thread: Re: Managed code, .H and .CPP
- Index(es):
Relevant Pages
|
Loading