Re: [Dev-C++] Copy Constructors and Overloaded Assignment Operators
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Matthew H. <mhi...@sy...> - 2002-07-22 21:47:33
|
Hello, >> Another rule >>to tag on >>to using static members for >>callbacks. >> >> >What do you mean with that? > > 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. Still trying to figure out some of the techniques for circumventing this. (Not fond of "thunking". How are other people accomplishing this? I've checked out the Reliable Software (?) methodolgy, but it seems a little on the fence between OOP and procedural programming...) >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. 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. I like simplicity and conciseness in code. Too much code, or too complex code, and it's just a pain to maintain. I'm still experimenting. When I get something worth posting, I'll put it out for public consumption/review 8-). |