Home > Archive > VC STL > April 2005 > Error C2923
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Zucky&Bruno 2005-04-13, 4:02 pm |
| Hello ,
These following lines are part of code from a template class to manage
different list.
-------------------------------------------------------------------------------------------
typedef std::pair<EltType,ReferenceType> QueueItem;
typedef std::list<QueueItem> QueueType;
typedef std::map<ReferenceType, QueueType::_Nodeptr> MapType;
-----------------------------------------------------------------------------------------
we have no problem to compile with Visual C++ 6 but we have these errors
with VS.Net 2003:
Error C2923:
d:\MIS_Projet\Client_Server\kfc\KfcBuffe
r.h(274): error C2923: 'std::map' :
'std::list<CKfcCycleBuffer<_Ty,_Ax>::QueueItem>::_Nodeptr' est un argument de
modèle '#2' non valide, type attendu
and Warning C4346:
d:\MIS_Projet\Client_Server\kfc\KfcBuffe
r.h(274): warning C4346:
'std::list<CKfcCycleBuffer<_Ty,_Ax>::QueueItem>::_Nodeptr' : le nom dépendant
n'est pas un type
Have you got any solutions for my problem
Thanks for your answer
Zucky
| |
| Tom Widmer 2005-04-13, 4:02 pm |
| Zucky&Bruno wrote:
> Hello ,
>
> These following lines are part of code from a template class to manage
> different list.
>
> -------------------------------------------------------------------------------------------
> typedef std::pair<EltType,ReferenceType> QueueItem;
> typedef std::list<QueueItem> QueueType;
> typedef std::map<ReferenceType, QueueType::_Nodeptr> MapType;
_Nodeptr is an undocumented implementation detail of std::list that
applies only to a specific version of a specific implementation of
std:list. Why are you using it in end user code? _Nodeptr has been made
protected in the implementation in VC7.1, but no correct code can tell
this, only incorrect code such as that above.
Also, you need "typename" when referring to a nested type in a dependent
type (that is, a type whose type isn't yet fixed - it depends on the
exact type or value of one or more template arguments). See below.
> -----------------------------------------------------------------------------------------
>
> we have no problem to compile with Visual C++ 6 but we have these errors
> with VS.Net 2003:
>
> Error C2923:
> d:\MIS_Projet\Client_Server\kfc\KfcBuffe
r.h(274): error C2923: 'std::map' :
> 'std::list<CKfcCycleBuffer<_Ty,_Ax>::QueueItem>::_Nodeptr' est un argument de
> modèle '#2' non valide, type attendu
>
> and Warning C4346:
> d:\MIS_Projet\Client_Server\kfc\KfcBuffe
r.h(274): warning C4346:
> 'std::list<CKfcCycleBuffer<_Ty,_Ax>::QueueItem>::_Nodeptr' : le nom dépendant
> n'est pas un type
>
>
> Have you got any solutions for my problem
I'd suggest either:
typedef std::map<ReferenceType, typename QueueType::iterator> MapType;
or:
typedef std::map<ReferenceType, typename QueueType::const_iterator> MapType;
That might be enough to get it compiling, or most likely you will need
to make some additional changes. Note that *none* of your code should be
using identifiers that start with _X where X is any uppercase letter,
unless you have specifically decided to use a *documented* extension.
Tom
| |
|
| Thank for your answer.
"Tom Widmer" wrote:
> Zucky&Bruno wrote:
>
> _Nodeptr is an undocumented implementation detail of std::list that
> applies only to a specific version of a specific implementation of
> std:list. Why are you using it in end user code? _Nodeptr has been made
> protected in the implementation in VC7.1, but no correct code can tell
> this, only incorrect code such as that above.
>
> Also, you need "typename" when referring to a nested type in a dependent
> type (that is, a type whose type isn't yet fixed - it depends on the
> exact type or value of one or more template arguments). See below.
>
>
> I'd suggest either:
> typedef std::map<ReferenceType, typename QueueType::iterator> MapType;
> or:
> typedef std::map<ReferenceType, typename QueueType::const_iterator> MapType;
>
> That might be enough to get it compiling, or most likely you will need
> to make some additional changes. Note that *none* of your code should be
> using identifiers that start with _X where X is any uppercase letter,
> unless you have specifically decided to use a *documented* extension.
>
> Tom
>
|
|
|
|
|