Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-23 22:51:25


"Ovanes Markarian" <om_boost_at_[hidden]> writes:

> Hello all,
>
> I am trying to specialize boost::is_pointer so, that it can determine if a type is a pointer
> wrapper (shared_ptr, auto_ptr, weak_ptr).

First of all, don't do that. It's a really bad idea, and it will
probably break some (Boost) library code. is_pointer is supposed to
detect real pointers, and if you start changing what it does with
other types, you'll break the expectations of every bit of code that
currently uses is_pointer. This has come up before, so maybe it
should be a FAQ (John?)

> Does anybody has ideas how this can be done? May be it would be
> possible to handle if e.g. one can determine if a class/struct has
> some typedef inside:

http://www.boost.org/libs/mpl/doc/refmanual/has-xxx-trait-def.html

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net