Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-01-06 19:09:42


"David Abrahams" <dave_at_[hidden]> wrote in message
news:u7kdhkfdj.fsf_at_boost-consulting.com...
> Howard Hinnant <hinnant_at_[hidden]> writes:
>
> OK, I see your point. How about:
>
> template <class T>
> struct my_container
> : if_<
> and_<
> is_pointer<T>
> , is_POD<remove_pointer<T> >
> >
> , impl1
> , impl2
> >::type
> {
> ...
> };

I think if you provided a copy c'tor that called memcpy() for
impl1, or some other POD optimization, that would motivate the
example for people who might be a little slow on the uptake
(like I am sometimes!). Otherwise, it seems like a decent
introduction. You might even be a little suggestive and call it
my_vector, to imply that you are creating a POD-optimized
vector (which people should be able to relate to easily enough).

Dave


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