Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-23 07:27:25

From: "Peter Dimov" <pdimov_at_[hidden]>

> From: "David Abrahams" <dave_at_[hidden]>
> > The smart pointers docs say:
> >
> > The requirement that the copy constructor of D does not throw is too
> > strong. It will be removed when some core language issues are resolved
> > (cv-qualified function types, partial ordering clarifications.)]
> >
> > Can you explain where that requirement comes from?
> The requirement comes from the pass by value. If the copy constructor
> throws, the pointer is leaked. Removing the requirement requires a pass
> (const) reference. The problems are that (1) pass by value conveniently
> changes functions (function references) to function pointers (this has to
> performed manually otherwise and some compilers may not be able to do it)
> and (2) const references don't currently (per the standard) bind to
> functions. This can be solved (I think) but it requires an overload set
> breaks on many compilers due to problems (and of course it will
> break on compilers that don't do partial ordering at all.)

Thanks! Could you please stick that text, verbatim, into your [...] section
so that it acts as more than just a "note-to-self"?

           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at