shared_ptr binary compatibility

Are shared_ptr binary compatible through boost versions? Example: Imagine a "Producer" class that sends shared_ptr to a "Consumer" class. Now imagine an executable that instanciate a Producer and a shared library (.dll or .so) that instanciate a Consumer. The executable is built with boost v1.xx. The shared library is built with boost v1.yy. If xx == yy, obviously there will be no problem since the version of the shared_ptr is the same. However if xx != yy, there might be a problem since the version of the shared_ptr might be binary imcompatible. Thanks, Philippe Cayouette -- View this message in context: http://www.nabble.com/shared_ptr-binary-compatibility-tp23985635p23985635.ht... Sent from the Boost - Users mailing list archive at Nabble.com.

On Thu, Jun 11, 2009 at 10:23 AM, pcayouette
Are shared_ptr binary compatible through boost versions?
Example:
Imagine a "Producer" class that sends shared_ptr to a "Consumer" class. Now imagine an executable that instanciate a Producer and a shared library (.dll or .so) that instanciate a Consumer. The executable is built with boost v1.xx. The shared library is built with boost v1.yy.
If xx == yy, obviously there will be no problem since the version of the shared_ptr is the same.
However if xx != yy, there might be a problem since the version of the shared_ptr might be binary imcompatible.
I don't think that there is a formal promise that shared_ptrs from different Boost versions are compatible but in practice I think that they are stable enough for some applications. I mean, occasionally you'd introduce breaking changes that require shared libs to be rebuilt anyway, right? That said, what's wrong with defining the shared library interface in C, as in: struct foo; foo * create_foo(); void destroy_foo( foo * ); In the client, you can still wrap this in a shared_ptr using a custom deleter. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
participants (2)
-
Emil Dotchevski
-
pcayouette