 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
robert Guest
|
Posted: Wed Sep 29, 2004 8:27 am Post subject: Problem mit Template class und Pointer für die Rückgabe (bei |
|
|
hallo leut'z
ich habe hier code der auf arm-compiler 1.2 läuft.
dieser code soll nun mit gcc 3.4 laufen (portierung zwecks
plattformwechsel).
ich bekomme nun folgende fehlermeldung:
......._startup.cpp:58:
......list.h:390: error: expected constructor, destructor, or type
conversion before '*' token
......list.h:390: error: expected `;' before '*' token
so nun der code
//beginn class
template<class TYPE, class ARG_TYPE>
class NList : public NObject
{
protected:
struct NNode
{
NNode* pNext;
NNode* pPrev;
TYPE data;
};
...
public:
// Construction
NList(tS16 nBlockSize = 10);
// Implementation
NNode* NewNode(NNode*, NNode*);
tVoid FreeNode(NNode*);
};
//beginn function NewNode
zeile:390
-> template<class TYPE, class ARG_TYPE>
NList<TYPE, ARG_TYPE>::NNode*
NList<TYPE, ARG_TYPE>::NewNode(NList::NNode* pPrev, NList::NNode*
pNext)
{
if (m_pNodeFree == NULL)
{
// add another block
NPlex* pNewBlock = NPlex::Create(m_pBlocks, m_nBlockSize,
sizeof(NNode));
// chain them into free list
NNode* pNode = (NNode*) pNewBlock->data();
// free in reverse order to make it easier to debug
pNode += m_nBlockSize - 1;
for (tS16 i = m_nBlockSize-1; i >= 0; i--, pNode--)
{
pNode->pNext = m_pNodeFree;
m_pNodeFree = pNode;
}
}
...
ConstructElements(&pNode->data, 1);
return pNode;
}
//end
was kann die ursache sein?
mir schein das er nicht erfasst um welches konstruk es sich handelt.
es könnte etwas fehlen um mehr eindeutigkeit zu erreichen.
hat jemand von euch eine idee? sieht er einen fehler?
gruße robert
--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
|
|
| Back to top |
|
 |
Christoph Bartoschek Guest
|
Posted: Thu Sep 30, 2004 5:03 pm Post subject: Re: Problem mit Template class und Pointer für die Rückgabe |
|
|
robert wrote:
| Quote: | zeile:390
-> template<class TYPE, class ARG_TYPE
NList
NList<TYPE, ARG_TYPE>::NewNode(NList::NNode* pPrev, NList::NNode*
pNext)
{
|
Mir scheint da fehlt ein typename:
template<class TYPE, class ARG_TYPE>
typename NList<TYPE, ARG_TYPE>::NNode *
NList<TYPE, ARG_TYPE>::NewNode(NList::NNode * pPrev, NList::NNode * pNext)
Christoph
--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|