Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-11-01 18:29:39


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>

> > > The precise language used in that "hand-waving" is important, because
it
> > > may open the door to much more 'evil' examples than that swap(b, d)
> > > thing.
> >
> > You have been prescient on this issue, so I won't argue. But I'd like to
> see
> > examples of what you have in mind.
>
> No concrete examples at the moment; I'd like to see the proposed text that
> will replace 17.4.3.1/1 first.
>
> I'm thinking along the lines of "derived can be used in place of base, any
> pointer would match a void *", that sort of thing.

Well, I think "not compiling" is outside the scope of the standard, at least
where the library is concerned. The standard never promises that invalid
uses of the library will fail to compile. Indeed 17.4.3.6 explicitly states:

1 In certain cases (replacement functions, handler functions, operations on
types used to instantiate standard library template components), the C++
Standard Library depends on components supplied by a C++ program. If these
components do not meet their requirements, the Standard places no
requirements on the implementation.
2 In particular, the effects are undefined in the following cases:
--- for replacement functions (18.4.1), if the installed replacement
function does not implement the semantics of the applicable Required
behavior paragraph.
--- for handler functions (18.4.2.2, 18.6.3.1, 18.6.2.2), if the installed
handler function does not implement the semantics of the applicable Required
behavior paragraph
--- for types used as template arguments when instantiating a template
component, if the operations on the type do not implement the semantics of
the applicable Requirements subclause (20.1.5, 23.1, 24.1,
26.1). Operations on such types can report a failure by throwing an
exception unless otherwise specified.
--- if any replacement function or handler function or destructor operation
throws an exception, unless specifically allowed in the applicable Required
behavior paragraph.
--- if an incomplete type (3.9) is used as a template argument when
instantiating a template component.

> You must realize that I am not against std:: overloading; it's that I'm
not
> sure whether this particular cure is not worse than the disease (in terms
of
> defect reports and newsgroups postings generated.)

I realize that. And I am not (neccessarily) against FTPS, though providing
for it does seem like the more difficult way to solve the immediate needs of
users. It is clear that we need to explore the two approaches some more
before we will come up with an acceptable solution.

-Dave


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