Wednesday, January 9, 2013

The Importans of Copy Constructors

Today I was working on my database software and I was having a horrible time figuring out what was going wrong.  Turns out that on my table I neglected to write the copy constructor.  I could have saved tons of time had I just taken the time to write one when I first put together the class (or if I had not made the assumption that I had previously written one into the code).

Although  it's really strange that I didn't have one.  When I was writing the image file format I used the table as a basis for the image file.  I also recall having a ton of trouble with getting the image file to copy correctly.  I ended up essentially writing in a function that performed the same function as the copy constructor.  I should have realized at that time that my table copy constructor was wrong.

No comments:

Post a Comment