Boost logo

Boost :

Subject: Re: [boost] Boost and exceptions
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2012-06-24 07:53:58


On 24.06.2012, at 00:56, Robert Ramey wrote:

> Daniel James wrote:
>> On 22 June 2012 20:41, Robert Ramey <ramey_at_[hidden]> wrote:
>
>> Well, shared_ptr has evolved. The interface has remained mostly
>> constant, but the internals have changed quite a lot, which has caused
>> some issues, particularly on more obscure platforms.
>
> lol - that's the way it's suppose to be.
>
> Time for a story. When I first made the serialization library, I couldn't
> serialize a shared_ptr. In order to do it I needed for shared_ptr to
> include friend::serialization. I asked Peter to do this and refused in
> a pretty abrupt way. This really annoyed me. After all, it was no
> big deal for him to add this one line!!!. His point was that
> by doing this it would tie his hands in the future implementation of
> shared_ptr. After some time I came to understand why he was
> right and I was wrong. As you can imagine this is sort of a rare
> event. I know it's not exactly the same as the current situation
> but it's similar in my view.

I completely disagree. They're not at all similar. You asked him to expose the implementation details of shared_ptr to you, a consumer of his library. By doing this, his library internals would have become interface, blocking change. Every implementation change would have been an interface change.
The change to throw_exception didn't do any such thing. It didn't change the interface. It didn't expose implementation details. All it did was change the implementation of an existing interface in a compatible (modulo bugs, and tightening the compile-time checking in a place where it was previously too lenient) way, and add a small dependency on a part of Boost.Exception along the way.

Sebastian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk