From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-11-20 14:02:57
Emily Winch wrote:
> > Ok, I agree in this case one can use super_subclass<T,
> > U>::type (can you say "pretty ugly")...
> Not half as ugly as ALL UPPERCASE :)
> Here is an argument that might be relevant.
> SUPER_SUBCLASS is essentially a function operating on types,
> that takes two types and returns a type.
> Functions are useful for all sorts of things including passing them
> to other functions for evaluating later.
> Making SUPER_SUBCLASS a macro would remove that option.
That's the agrument that I was going to bring too :).
> At the moment I can't think of a practical situation in which
> it would be useful to pass super_subclass as a template template
> parameter, but it might be worth keeping in mind.
Here is one example:
namespace mpl = boost::mpl;
template<typename T1, typename T2>
BOOST_STATIC_CONSTANT(bool, value = (
boost::is_convertible<T2 const*, T1 const*>::value
&& boost::is_same<T1 const*, void const*>::value
typedef mpl::type_list<...> types; // something meaningful :)
I am not claim that the above code has any practical value, of course :).
But if you replace 'remove_if' with 'find_if', or 'count_if', or 'sort',
etc. (see boost/mpl for the complete list of the algorithms :) - it might.
BTW, Emily, I've read you paper
(http://www.oonumerics.org/tmpw01/winch.pdf), and I am impressed both by the
work you did, and by the fact how close an independent work of two people
can be ;). As Dave has already mentioned, a little while ago I too wrote a
couple of simple tuple extensions
(http://groups.yahoo.com/group/boost/files/tuple_ext/), some of which, as I
know now, are scarily close to what your paper describes :). Of course, you
work is much more thought-out than mine (I've spent only a few days on the
whole topic :), but if you are interested to cooperate - I would be more
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk