Boost logo

Boost :

From: Terence Wilson (tez_at_[hidden])
Date: 2002-09-23 13:24:54


Can't you use:

template < typename T > void f(T* ptr )
{
        T& ref = *ptr;
        // ... do something with ref ...
}

?

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Bohdan
> Sent: Monday, September 23, 2002 10:20 AM
> To: boost_at_[hidden]
> Subject: [boost] pointer_traits ?
>
>
> I have following code:
>
> template < typename PointerT > void f( PointerT ptr )
> {
> ReferenceT ref = *ptr;
> // ... do something with ref ...
> }
>
> The problem is that ReferenceT is unknown inside f( ... ).
> If i had similar code for InteratorT instead of PointerT i
> was using iterator_traits. AFAIK there is no pointer traits
> for a raw and smart pointers and i can not use type_traits
> for smart pointers. So, the question is: "Is there some
> simple solution for this problem or this is just lack of
> pointer_traits in boost (std?) ?"
>
> regards,
> bohdan
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/bo> ost
>


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