Please Help with my program

I am getting the following error when run the code with the following destructor.


------ Build started: Project: Harris_CS3330_1.1, Configuration: Release Win32 ------
Compiling...
Harris_CS3330_1.1.cpp
y:\documents\school_work\data_structure\Harris_CS3330_1.1.cpp(297) : error C2039: '{dtor}' : is not a member of 'Database<T>'
Build log was saved at "file://\\.psf\.home\documents\school_work\data_structure\harris_cs3330_1.1\harris_cs3330_1.1\Release\BuildLog.htm"
Harris_CS3330_1.1 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





template<class T>
Database<T>::~Database()
{
// Copy nonnull records to new file
// Delete old data file
// rename new file old filename
fstream dbout;
T tmp;
database.open(fName,ios::in|ios::out|ios::binary);
dbout.open("tmpfile",ios::out|ios::binary);
database.clear();
while (true)
{
tmp.readFromFile(database);
if (database.eof())
break;
if (!tmp.isNull())
{
dbout.clear();
dbout.seekp(0,ios::end);
tmp.writeToFile(dbout);
}
}
dbout.close();
database.close();
std::remove(fName);
std::rename("tmpfile",fName);


return;

}
Last edited on
Topic archived. No new replies allowed.