Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-11 12:35:14


Howard Hinnant <hinnant_at_[hidden]> writes:

> On Saturday, January 11, 2003, at 09:42 AM, Beman Dawes wrote:
>
>> >Or maybe even just:
>> >
>> > template <class T>
>> > struct my_container
>> > : if_<is_POD<T>::value, impl1, impl2>::type
>> > {
>> > ...
>> > };
>>
>> These are the examples that resonate with me,
>> particularly Howard's version. It looks so easy, and
>> has obvious practical uses. It would motivate me.
>>
>> But it needs to be a complete, compilable, runable,
>> program so I can try it, modify it, etc.
>
> Despite the fact that I suggested it, I don't find it a
> killer example. ;-)

I'm not sure we're looking for one. Is the classic "hello, world" a
killer example of why traditional C++ is cool? I don't think so. On
the other hand, if you've never seen C++, you can get a feeling for
what it's like to work with the language from looking at "hello,
world".

> I already code stuff like this, with this other pattern:

<snip simple metaprogramming example>

> I'm not convinced that the version using if_ is
> significantly simpler. :-\

I don't think we're trying to beat that example by very much. The
person already familiar with metaprogramming won't find much to be
impressed with, unless they look very closely, in which case it will
only be slightly intriguing. I think that's more than you can say for
classic "hello, world".

-Dave

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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