|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-11-13 10:03:09
----- Original Message -----
From: "Kevlin Henney" <kevlin_at_[hidden]>
> >If I understand your class right, the reason for wording things as I have
> >suggested is illustrated even better by:
> >
> >struct Foo { ... };
> >any y(1);
> >any x(Foo());
> >y = x; // y has contents (1), x has contents (Foo()). I presume x's
contents
> >get copied?
>
> Yes, which is what my wording says but not yours :->
No, your wording says "May fail with a std::bad_alloc exception or any
exceptions arising from the copy constructor of the contained type"
In this case there are two contained types participating (int and Foo). Your
wording does not indicate which one's cctor might throw.
My wording was: "may throw anything thrown by the copy constructor of the
contents of rhs, or std::bad_alloc"
I'd like to rephrase that as "may throw std::bad_alloc or any exception
thrown by the copy constructor of the contents of rhs", but you get the
idea...
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk