
5 Nov
2009
5 Nov
'09
7:11 a.m.
On Wed, Nov 4, 2009 at 11:10 PM, Gottlob Frege <gottlobfrege@gmail.com> wrote:
On Wed, Nov 4, 2009 at 8:16 PM, Geoff Hilton <geoff.hilton@t-optlogic.com> wrote:
I'm writing a public api for a product which will be bundled as a precompiled dll or binary and one of my goals is binary compatibility template<typename T> class MyClass { public: T foo(); private: boost::shared_ptr<MyClassImpl<T> > impl; };
Use boost::intrusive_ptr<> and make sure the intrusive_ptr_add_ref(T) and intrusive_ptr_release(T) are implemented _inside_ your DLL.
That is about as stable binary interface as boost::shared_ptr. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode