|
Boost : |
From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-10-19 12:34:02
I would be stunned to see "not throw" if the stored pointer contained ~0
for any (sizeof *px) > 1
I agree w/ Daniel, the "// never throws" is confusing
At Saturday 2002/10/19 08:10, you wrote:
>From: "Daniel Frey" <d.frey_at_[hidden]>
> > Hi,
> >
> > I have a (maybe dumb) question. The current version of shared_ptr contains
>code
> > like:
> >
> > typename detail::shared_ptr_traits<T>::reference operator* () const //
>never throws
> > {
> > BOOST_ASSERT(px != 0);
> > return *px;
> > }
> >
> > What does "never throws" means
>
>It means that operator* doesn't throw when its requirements ("The stored
>pointer must not be 0") are met, otherwise the behavior is undefined.
>
> > ... wrt BOOST_ASSERT?
>
>BOOST_ASSERT(px != 0) must not throw when px != 0.
>
> > Isn't this a contradiction?
>
>No. :-)
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
"There oughta be a law"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk