Discussion:
typedef Diagnostic (C2926)
(too old to reply)
Mike Copeland
2010-09-02 17:51:21 UTC
Permalink
What is wrong with the following code? It's similar to other code
I've successfully written and used, but I'm getting a compiler
diagnostic on the "typedef" line (C2926). Please advise. TIA

struct Corrals
{
int corralNumber;
int corralLimit;
} corralWork;
typedef list<Corrals> CorralList;
CorralList corralData;
list<CorralList>::iterator corralIter;
Bo Persson
2010-09-02 17:56:00 UTC
Permalink
Post by Mike Copeland
What is wrong with the following code? It's similar to other code
I've successfully written and used, but I'm getting a compiler
diagnostic on the "typedef" line (C2926). Please advise. TIA
struct Corrals
{
int corralNumber;
int corralLimit;
} corralWork;
typedef list<Corrals> CorralList;
CorralList corralData;
list<CorralList>::iterator corralIter;
Is this inside some other function? In C++98 you cannot use local
classes as template parameters.


Bo Persson
Mike Copeland
2010-09-02 18:03:16 UTC
Permalink
Post by Bo Persson
Post by Mike Copeland
What is wrong with the following code? It's similar to other code
I've successfully written and used, but I'm getting a compiler
diagnostic on the "typedef" line (C2926). Please advise. TIA
struct Corrals
{
int corralNumber;
int corralLimit;
} corralWork;
typedef list<Corrals> CorralList;
CorralList corralData;
list<CorralList>::iterator corralIter;
Is this inside some other function? In C++98 you cannot use local
classes as template parameters.
Ahh, yes. It is just that. I was developing some new code and would
have moved the data out of its using code. Thanks for the prompt reply
(hopefully I'll remember this object lesson. 8<{{

Loading...