How to fix this code?

B

Bredal Jensen

The code below compiles fine with vc++.6 but not with vc++.net



the error message is:



...\RegistryArray_demo\RegistryArray\RegArray.h(28): error C3860: template
argument list following class template name must list parameters in the
order used in template parameter list





What does this mean ???



Many thanks in advance.




#ifndef RegArray_h

#define RegArray_h

#include <afxtempl.h>

template <class T, class F>

class CRegArray:public CArray<T, F>

{

public:

CRegArray(const CString sSection, const CString sArrayName);


void FetchRegistry();

void PersistRegistry();

private:

const CString m_sSection;

const CString m_sArrayName;

const CString m_sCounterName;

};



template <class T, class F>

inline CRegArray<T,T&>::CRegArray(const CString sSection, const CString
sArrayName):CArray<T,F>(),

m_sSection(sSection),

m_sArrayName(sArrayName),

m_sCounterName(sArrayName+"_Counter")

{

}

template <class T, class F>

inline void CRegArray<T,T&>::FetchRegistry()

{

int nCounter = AfxGetApp()->GetProfileInt(m_sSection, m_sCounterName, 0);

for(int i = 0; i < nCounter; i++){

CString sElmName;

sElmName.Format("%s %d",m_sArrayName, i);

CString sTmp = AfxGetApp()->GetProfileString(m_sSection, sElmName, "");

CSomeClass clTmp;

clTmp.Parse(sTmp);

Add(clTmp);

}

}

template <class T, class F>

inline void CRegArray<T,T&>::persistRegistry()

{

AfxGetApp()->WriteProfileInt(m_sSection, m_sCounterName, GetSize() );

for(int i=0;i<GetSize();i++){

CString sElmName;

sElmName.Format("%s %d",m_sArrayName, i);

AfxGetApp()->WriteProfileString(m_sSection, sElmName,
(*this).GetAsString() );

}

}

#endif
 
V

Vladimir Nesterovsky

The code below compiles fine with vc++.6 but not with vc++.net
the error message is:

..\RegistryArray_demo\RegistryArray\RegArray.h(28): error C3860: template
argument list following class template name must list parameters in the
order used in template parameter list

What does this mean ???

replace

template <class T, class F>
inline CRegArray<T,T&>:: ...

with

template <class T, class F>
inline CRegArray<T,F>:: ...
 
B

Bredal Jensen

Many thanks...

That solved my problem.

By the way. do you know why VS.NET can not locate

<strstrea.h>?
 
C

Carl Daniel [VC++ MVP]

Bredal said:
Many thanks...

That solved my problem.

By the way. do you know why VS.NET can not locate

<strstrea.h>?

It, along with all "classic IOStreams" headers, was removed from the product
starting with VC7.1 (they were deprecated starting with VC7).

-cd
 

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

Top