Boost logo

Boost :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2004-02-28 19:41:43

At Saturday 2004-02-28 12:39, you wrote:
>Glen wrote:
> > >I guess I don't understand the whole concept now. T* ->
> > void* sounds
> > >like "narrowing", since it loses information. int -> long
> > never loses
> > >information, so "widening" makes sense to me. What is the criterion?
> >
> > This is why I like C++'s choice of base and derived, there's
> > never any confusion. You have the concepts of narrowing and
> > widening correct but backwards. You narrow a type to a more
> > specific derived type and widen one to a more general base type.
>That is why we should always use "covariant" and "contravariant"

oh yeah, covariant and contravariant are pellucidly clear </extreme sarcasm>
they also differ by only 3 letters (in the middle) and are hard to read

>conversions, instead of (the proper but potentially confusing - if the
>reader is in "number of bits" mode) "narrowing" and "widening."
>This confusion leads to a shock when encountering the pointer-to-pointer
>conversions in C++. One has to understand the oscillation between covariance
>and contravariance when the indirections are traversed.
>I will personally spam the next writer using "narrowing" or "widening" ;-)
>Unsubscribe & other changes:

Victor A. Wagner Jr.
The five most dangerous words in the English language:
               "There oughta be a law"

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