A
AlanJSmith
I am converting some C++ projects from 6 to vs2005 in one of the headers i
have the code that follows this passage in which I get an error saying int
default cant be assumed so i added DBString<nSize> DBString<nSize>:: to the
copy assignment same size oporator and this seems to work, if i try the same
thing with copy assignment different sizes i get error C3856:
'DBString<nSize>::=': class is not a class template and adding any type
between template<int nInSize> and operator = without the DBString<nSize>::
gives me a c++ optimizer had to close send error report to microsoft error.
I have been searching for an answer for a couple of hours now can any one
help please.
template<int nSize> class DBString
{
public:
............
// copy assignment (different size)
template<int nInSize> operator =(const DBString<nInSize>& strNewValue)
{
strncpy((char*)strValue,(char*)strNewValue.strValue,nInSize);
nIndicator = strNewValue.nIndicator;
}
// copy assignment (same size)
DBString<nSize> DBString<nSize>:perator =(const DBString<nSize>&
strNewValue)
{
strncpy((char*)strValue,(char*)strNewValue.strValue,nSize);
nIndicator = strNewValue.nIndicator;
}
have the code that follows this passage in which I get an error saying int
default cant be assumed so i added DBString<nSize> DBString<nSize>:: to the
copy assignment same size oporator and this seems to work, if i try the same
thing with copy assignment different sizes i get error C3856:
'DBString<nSize>::=': class is not a class template and adding any type
between template<int nInSize> and operator = without the DBString<nSize>::
gives me a c++ optimizer had to close send error report to microsoft error.
I have been searching for an answer for a couple of hours now can any one
help please.
template<int nSize> class DBString
{
public:
............
// copy assignment (different size)
template<int nInSize> operator =(const DBString<nInSize>& strNewValue)
{
strncpy((char*)strValue,(char*)strNewValue.strValue,nInSize);
nIndicator = strNewValue.nIndicator;
}
// copy assignment (same size)
DBString<nSize> DBString<nSize>:perator =(const DBString<nSize>&
strNewValue)
{
strncpy((char*)strValue,(char*)strNewValue.strValue,nSize);
nIndicator = strNewValue.nIndicator;
}