Overload assignment operator for assigning sql::ResultSet to struct tm
- by Luke Mcneice
Are there exceptions for types which can't have thier assignment operator overloaded?
Specifically, I'm wanting to overload the assignment operator of a struct tm (from time.h) so I can assign a sql::ResultSet to it.
I already have the conversion logic:
sscanf(sqlresult->getString("StoredAt").c_str(), "%d-%d-%d %d:%d:%d",
&TempTimeStruct->tm_year, &TempTimeStruct->tm_mon, &TempTimeStruct->tm_mday,
&TempTimeStruct->tm_hour, &TempTimeStruct->tm_min, &TempTimeStruct->tm_sec);
I tried the overload with this:
tm& tm::operator=(sql::ResultSet & results)
{
/*CODE*/
return *this;
}
However VS08 reports:
error C2511: 'tm &tm::operator =(sql::ResultSet &)' : overloaded member function not found in 'tm'