> Another approach is suggested by Herb Sutter in "Exceptional > C++". See "the pimpl idiom".
I have used this technique a bit, but I criticize it because of several problems: 1. It dynamically allocates an object for each instance of your class created anywhere of the app (both inefficient use of CPU and memory.) 2. It complicates the code a *lot*. It basically adds a(n unneeded) level of indirection for each member variable access, which causes your code both harder to read and write (and probably less efficient, if it matters.) 3. It's not understandable to many people (probably except those who already know it) and will probably cause maintenance problems. It has its own merits (like any technique suggested by gurus like Sutter) but it's not what you want to do with each and every poor C++ class. IOW, read about it to have it in your toolset for when the need arises. ------------- Ehsan Akhgari Farda Technology (http://www.farda-tech.com/) List Owner: [email protected] [ Email: [EMAIL PROTECTED] ] [ WWW: http://www.beginthread.com/Ehsan ] But the thought is one thing, the deed another, and the idea of the deed still another. The wheel of causality does not roll between them. -Thus Spoke Zarathustra, F. W. Nietzsche _______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
