Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-13 14:57:17


One interesting fact which might be exploited: given

    template <class T> void f(T&);

On VC6.5, the type of &f<X&> appears to be void(*)(X*&)

-Dave

----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, March 13, 2002 2:28 PM
Subject: Re: [boost] type_traits: workaround bias

> > BOOST_STATIC_ASSERT(sizeof(f<X>(wraps<X&>())) == 1);
> oops, missed this-------------^^^
>
> It wasn't an SP5 thing, it was the above.
> However, how can we apply that? To even write that, you not only need
to
> know that X is a reference, you need to know what it refers to!
>
> -Dave
>
> ----- Original Message -----
> From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
>
> > 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/
>
>
>


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