|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-01-06 17:25:06
On Monday, January 6, 2003, at 01:14 PM, David B. Held wrote:
> While this is a cute idea, my first impression would be: "Uh...is this
> really something I could use in my own code?" On the other hand,
> I seem to use compile-time if more than anything else, even in "user
> code". I suspect that most people will use mpl::if_ and type traits
> more than anything else, so I think Dave's original example with
> is_pointer<> would connect with the most programmers. On the
> other hand, I suspect that library authors are more likely to use the
> type containers and algorithms, so an example illustrating those might
> be more appropriate for them. So I guess it depends on the
> intended audience.
I would be careful that your target audience doesn't look at the
"helloworld" and say, gee, why don't I just use existing language
features:
template <class T>
struct my_container
{
// impl2 ...
};
template <class T>
struct my_container<T*>
{
// impl1 ...
};
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk