a question declaring a STL container holding iterators

M

moggous phar

how i have to declarate stuff like this:

typedef struct { PfadIter Parent; CString Name; } PFADSTRUCT;

typedef PfadMapType::iterator PfadIter;
typedef std::map<PFADSTRUCT, int> PfadMapType;


is there any uncomplete decl like

struct A;
struct B {struct A *pa};
struct A {struct A *pa};


I'm using MS VC++ 6

Thanks,
Moggous
 
G

Gianni Mariani

moggous said:
how i have to declarate stuff like this:

typedef struct { PfadIter Parent; CString Name; } PFADSTRUCT;

typedef PfadMapType::iterator PfadIter;
typedef std::map<PFADSTRUCT, int> PfadMapType;

you don't need to use typedef's when declaring a struct - it really is
not somthing you want to do.

struct PFADSTRUCT { PfadIter Parent; CString Name; };
typedef PfadMapType::iterator PfadIter;
typedef std::map<PFADSTRUCT, int> PfadMapType;

Well, this is not somthing you can do with the STL.

One alternative is:

struct PFADSTRUCT;
typedef PfadMapType::iterator PfadIter;
typedef std::map<PFADSTRUCT *, int> PfadMapType;
struct PFADSTRUCT { PfadIter Parent; CString Name; };

I use reference counted objects in this case:

struct PFADSTRUCT;
typedef PfadMapType::iterator PfadIter;
int> PfadMapType; said:
is there any uncomplete decl like

struct A;
struct B {struct A *pa};
struct A {struct A *pa};


I'm using MS VC++ 6

Use somthing better. VS 7.1 is much much better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top