Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-30 13:42:33


From: "Gennaro Prota" <gennaro_prota_at_[hidden]>
> On Thu, 30 Jan 2003 10:19:53 -0500, David Abrahams
> <dave_at_[hidden]> wrote:
>
> >Peter D. has effectively argued in the past that void *is* a supertype
> >of everything (well, every object type, as opposed e.g. to
> >function/function pointer types). Given the foregoing discussion
> >about squares and rectangles it may be the *only* supertype that we
> >can detect with certainty.
>
> And since Peter D. is not in the habit of making trivial errors, this
> makes me wonder in fact what definition of "supertype" he was
> considering.

The practical one. I.e. if you use is_base_and_derived<B, D> somewhere, do
you want "true" for B=void, if B can be void?

For example, if you write a class template X<T> that is supposed to only
operate on types derived from T (e.g. an inheritance-bounded variant), how
would you denote the unbounded case?

A related question would be: if you had common_base<X, Y>::type, what would
you want returned when X and Y have no common base?


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