2 replies
by kevlin
Alas, the technique described in this C++ tip demonstrates one way of not solving this problem :-( It is at best half the solution, but it fails to finish the job, leaving memory management unencapsulated, exposing the user to far, far more complexity than they need.
The final solution can -- and should -- be simpler in implementation and easier to use. For the relevant techniques, have a look at my CUJ online article from November 2000, "Function Follows Form":
http://www.cuj.com/experts/1811/henney.htm
Kevlin
by john torjo
Hi Kevlin,
Thanks for your feedback.
You are partially correct. It was sloppy of me to leave out memory management.
However, should have I included that, I guess the code would have become more complicated.
In a future tip, I will show a way to be able to keep pointers in a container, and manage memory management (destruction) internally.
John
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending