RE: [Dev-C++] Copy Constructors and Overloaded Assignment Operators
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-07-25 21:42:08
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Matthew Hickson > Sent: Tuesday, July 23, 2002 12:50 AM > To: 'Dev-C++ Mailing List' > Subject: Re: [Dev-C++] Copy Constructors and Overloaded > Assignment Operators > > > Hello, > > As I understand it... callback (particularly in Windows, but other UI > toolkits aswell) > need to be static class members. It pertains to the implied > "this" that > is passed to > non-static members. Causes a world of difficulty as I understand it. C++ is the child of gods. It can't be wrong. :) static members are intended for class-wide operations. > >Well i guess you can use a reset() member function with no > values stored > >in disk. > > > > > True. However, I'd be aiming to restore to a previous state... not > necessarily a "blank" initial state. Well you can create double data members, one for the previous state and one for the current state. > > To that end, I'd want to capture a state... and then update it (as > changes were accepted by the end > user), but allow a fallback to a previous state. The only other... > seemingly true OOP solution I see > is to have a property method that retains the previous value (saw > something like this mentioned in > a rogue-like game development newgroup). The only problem > being is that > it creates a ton of > member functions for maintenance. Why. > I like simplicity and conciseness in code. Too much code, or too > complex code, and it's just a > pain to maintain. You can create backup data members. The space cost can't be that large. Of course you can store everything in files, but that implies time cost. Obviously you have to make a trade off between run-time cost and memory space cost. This is not an OO problem not a C++ problem. I did not however understand why do you want to access normal data members through static member functions. If the backup values are the same for all objects you can create static data members and access them through usual member functions if you wish. That static-members issue of yours confused me. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |