Boost logo

Boost Users :

Subject: Re: [Boost-users] Avoiding reinventing the wheel for a public api with binary compatibility in mind
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-11-05 02:11:54


On Wed, Nov 4, 2009 at 11:10 PM, Gottlob Frege <gottlobfrege_at_[hidden]> wrote:
> On Wed, Nov 4, 2009 at 8:16 PM, Geoff Hilton
> <geoff.hilton_at_[hidden]> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net