VC++2005 equivalent code of partial C# keyword

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
in C# : Partial type definitions allow the definition of a class, struct or
interface to be split into multiple files.
I'd like to have the equivalent keyword of partial in VC++
does someone has an idea?
Thanks in advance
 
tlemcenvisit said:
Hello
in C# : Partial type definitions allow the definition of a class, struct or
interface to be split into multiple files.
I'd like to have the equivalent keyword of partial in VC++
does someone has an idea?

You can only split the definition of a class'
member functions over as many file as you
like. The class itself needs to be defined in
one piece.
Thanks in advance


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett
 
tlemcenvisit said:
I want an equivalent to "partial" keyword


Which I don't know.

Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett
 
tlemcenvisit said:
Hello
in C# : Partial type definitions allow the definition of a class,
struct or interface to be split into multiple files.
I'd like to have the equivalent keyword of partial in VC++
does someone has an idea?
Thanks in advance

There is no equivalent.

-cd
 
Hello
in C# : Partial type definitions allow the definition of a class, struct
or
interface to be split into multiple files.
I'd like to have the equivalent keyword of partial in VC++
does someone has an idea?
Thanks in advance

Hmmmm in what context would you like this? Meaning, why exactly
you want to split a class definition in multiple .h files?

You could always play with the preprocessor, I believe!

ClassX.h:
--------Cut here --------------
class X
{
public:
void f1();
void f2();
void f3();

#include "classX2.h"
--------Cut here --------------

ClassX2.h:

--------Cut here --------------
void f4();
void f5();
#include "classX3.h"
--------Cut here --------------

ClassX3.h:

--------Cut here --------------
private:
void f6();
int a,b,c;

}
--------Cut here --------------

But I don't easily see an advantage on doing this and wouldn't recommend it.

Fabro
 
Back
Top