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 CRegArrayublic 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&>:ersistRegistry()
{
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
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 CRegArrayublic 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&>:ersistRegistry()
{
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