Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-13 13:35:51


I'm downloading SP5 as I type. I was under the impression that they
didn't make compiler changes for SP5, but I guess I was mistaken!

I'm not sure what the code below has to do with anything. THat would be
illegal on a conforming compiler because you're using T in a nondeduced
context.

-Dave

----- Original Message -----
From: "Yitzhak Sapir" <ysapir_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, March 13, 2002 1:32 PM
Subject: RE: [boost] type_traits: workaround bias

> I compiled that with VC6SP5
>
> At that time I was looking at the following, which may explain the
> error:
>
> struct X;
> template <class T> struct wraps{ struct id {}; };
> template <class T> char f(wraps<T&>::id);
> int main()
> {
> sizeof(f(wraps<X&>::id()));
> return 0;
> };
>
> this says:
> error C2664: 'f' : cannot convert parameter 1 from 'struct
wraps<struct
> X &>::id' to 'struct wraps<struct X * &>::id'
> No constructor could take the source type, or constructor
> overload resolution was ambiguous
>
>
> > -----Original Message-----
> > From: David Abrahams [mailto:david.abrahams_at_[hidden]]
> > Sent: Wednesday, March 13, 2002 8:24 PM
> > To: boost_at_[hidden]
> > Subject: Re: [boost] type_traits: workaround bias
> >
> >
> > Which version of VC are you using?
> > I get the ICE with 6sp4.
> > It would be pretty damned exciting if we could get this to work...
> >
> > -Dave
> >
> > ----- Original Message -----
> > From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> >
> >
> > > David Abrahams wrote:
> > > > > metafunctions, and that doesn't help the compiler. Without
> > > > > seeing the code and errors I can't say if that's the case, but
> > > > > there is a chance that using something named less
> > > > > provocative as a wrapper template can help here.
> > > >
> > > > Tried that, too :^(
> > > >
> > > > struct X;
> > > > template <class T> struct wraps{};
> > > > template <class T> char f(wraps<T&>);
> > > > int main()
> > > > {
> > > > sizeof(f(wraps<X&>()));
> > > > return 0;
> > > > };
> > >
> > > This compiles:
> > >
> > > #include "boost/static_assert.hpp"
> > >
> > > struct X;
> > > template <class T> struct wraps{};
> > > template <class T> char f(wraps<T&>);
> > > template <class T> char(& f(void const volatile*))[2];
> > >
> > > int main()
> > > {
> > > BOOST_STATIC_ASSERT(sizeof(f<X>(wraps<X&>())) == 1);
> > > return 0;
> > > }
> > >
> > >
> > > Info: http://www.boost.org Send unsubscribe requests to:
> > <mailto:boost-unsubscribe_at_[hidden]>
> > >
> > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> >
> >
> > Info: http://www.boost.org Send unsubscribe requests to:
> > <mailto:boost-unsubscribe_at_[hidden]>
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>


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