quote:Original post by civguy
I don''t know how it solves memory leaks either. If it was totally transparent, it would solve them. But now that I have to actively type
typedef boost::shared_ptr<string> SharedStringPtr;
And then use SharedStringPtr everywhere, so it''s actually more burden than adding a deleteContainer(cont); into the destructor.
As I said: "you could write your own smart pointer if you want to". This smart pointer could have an implicit constructor (boost::shared_ptr''s constructor is explicit) and an implicit convertion operator to the contained type (boost::shared_ptr doesn''t have an implicit convertion operator, you must go via the get member function), then it will be totally transparent.
[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]