|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-11-12 14:18:03
----- Original Message -----
From: "Kevlin Henney" <kevlin_at_[hidden]>
> >AFAIK we have no non-exception-safe classes. Saying what you've said may
> >have inadvertent implications. In fact, any class with even a pathetic
> >exception policy is exception-safe for some definition of "safe" (e.g. "I
> >promise not to crash as long as you don't throw anything"). So here's my
> >last petition: I don't think you should say it.
>
> I'm going to leave it as is, as it does not seem to confuse most people
Most people don't think about what "exception-safe" might mean, or about the
range of possible meanings.
> and I cannot see what inadvertent implications you are referring to --
For example, that other boost classes are not exception-safe.
> all members satisfy the strong or no throw gtee (this might be worth
> documenting).
Yes! That at least has some value as information, wheras the statement that
it is exception-safe has (almost) none.
> Given the standard definitions of exception safety (yours :->), in what
> way is any not exception safe?
It depends what your definition of exception-safe is. I /don't/ give a
formal definition of exception-safety (though I do try to capture the
informal notion). Rather, I supply 3 /distinctions/ we can use to talk about
exception-safety.
> Given my experience of the programming
> populace, including the statement is of more benefit than harm.
You have more experience with instruction than I do, admittedly.
> >> >> Non-throwing destructor that releases any and all resources used in
> >> >management
> >> >hmm, watch your language----------------^^^ !
> >>
> >> Watch your formatting ;-)
> >
> >Seriously, there's no need to say "any and" here, is there? It doesn't
add
> >anything, does it?
>
> It clarifies that it cannot be reference counted.
How? That's completely non-obvious to me. It seems to me that saying "X
releases all resources used..." means exactly the same thing as "X releases
any and all resources used..." Am I missing something here?
> >> >> any & operator=(const any & rhs);
> >> >>
> >> >> Copy assignment operator
> >> >
> >> >Why say that part?
> >>
> >> Because there not all assignment operators are copy assignment
> >> operators, eg the templated assignment operator.
> >
> >Okay, but "anyone" can see that it's a copy assignment operator because
the
> >signature's right there...no?
>
> It has a proper name, and I cannot see any drawbacks to referring to
> something by its proper name.
I have been trying to nudge you towards a more minimalist style of
documentation, which favors concise presentation of relevant information. My
experience (and admittedly, it might just be me) of reading your docs was
that there were a lot of extra words used to describe something that should
be simple. Much of that tended to obscure the important information (for
me).
> >> The "copy constructor of the contents of rhs" does not seem to make
> >> sense :-}
> >
> >Not sure why.
>
> Because rhs's content's copy constructor is of no interest :->
Are you saying that when I write this:
struct Foo { ... };
any x(Foo());
any y(x);
that Foo::Foo(const Foo&) is not called by the last line? If not, I have
completely misunderstood your documentation and more clarification is
probably warranted.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk