Boost logo

Boost :

From: Michiel Salters (Michiel.Salters_at_[hidden])
Date: 2002-02-21 10:35:28


> -----Original Message-----
> From: David Abrahams [mailto:david.abrahams_at_[hidden]]
> Sent: donderdag 21 februari 2002 14:13
> To: boost_at_[hidden]
> Subject: Re: [boost] Re: Most needed/desired features in C++
>
>
>
> ----- Original Message -----
> From: "Michiel Salters" <Michiel.Salters_at_[hidden]>
>
>
> > > template< template<typename> class F > struct my {};
> > > template<typename T, typename U = T> struct her {};
> > >
> > > int main()
> > > {
> > > sizeof(my<her>); // should not compile, but ok with
> > > GCC/Borland
> > > return 0;
> > > }
> >
> > What's the point of this example ?
>
> The point, if you read further on, is that the compiler complains of
> ambiguities later because each of two templates match equally well.

Ah - it's matched equally well. I assumed they would have taken the
same approach as with for-loop scoping. That is, if there is an
unambiguous standard-conforming way to interpret it, use that. Else,
try the extension to see if it compiles that way.

Do you think this would be a safe & useful extension when implemented
this way?

Regards,

-- 
Michiel Salters

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