Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-21 14:02:56


If you can implement this without partial specialization or get my company
to drop MSVC you'll be my hero ;-).
-Dave
----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, December 21, 2000 1:48 PM
Subject: Re: [boost] type_traits: remove_pointer?

> FWIW, remove_pointer could handily be used to implement is_pointer:
>
> template <class T> struct is_pointer
> {static const bool value = !is_same<T, typename
> remove_pointer<T>::type>::value;};
>
> (assuming of course that remove_pointer removed pointers and top-level
> cv-qualified pointers, else returned the original type)
>
> template <class T> struct remove_pointer {typedef T
> type;};
> template <class T> struct remove_pointer<T*> {typedef T
> type;};
> template <class T> struct remove_pointer<T*const> {typedef T
> type;};
> template <class T> struct remove_pointer<T*volatile> {typedef T
> type;};
> template <class T> struct remove_pointer<T*const volatile> {typedef T
> type;};
>
> -Howard
>
> David Abrahams wrote on 12/21/2000 11:05 AM
> >I notice there is a remove_reference<T> but no remove_pointer<T> in
> >type_traits. Oversight? Rationale?
>
>
>


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