
On Wed, Nov 4, 2009 at 5:16 PM, Geoff Hilton
Using boost::shared_ptr would be great, but this means clients of my code would have to have the same version of boost installed that we use, and I imagine this could cause conflicts in the event that they happen to use boost (and a different version of it).
In theory, yes, they must use the same version of boost. In practice, you'll be surprised how resilient shared_ptr is to breaking binary compatibility across boost versions. That said, if you want to be bullet-proof, you can do pimpl the old fashion way: struct foo; foo * create_foo(....); void destroy_foo( foo * ); void use_foo( foo * ); Note that users can still easily use shared_ptr: boost::shared_ptr<foo> x(create_foo(....),destroy_foo); Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode