|
Boost : |
From: Greg Colvin (Gregory.Colvin_at_[hidden])
Date: 2003-01-07 12:22:59
At 05:09 PM 1/6/2003, David B. Held wrote:
>"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).
I like this suggestion a lot. A simple, useful example that
can't easily be done without something like MPL.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk