Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-04-10 18:30:12


"Jeff Garland" <jeff_at_[hidden]> wrote in message
news:LPBBLOEIMCKBCMMHJMGAIEGLDMAA.jeff_at_crystalclearsoftware.com...
> [...]
> Just looking at mpl bit it appears to me that from the pure user (not
library writer)
> perspective creating mpl typelists will be cleaner (only slightly) than
Loki typelists.
> Here it is side by side:
>
> struct foo;
> typedef boost::mpl::type_list<int, long, foo> mpl_typelist;
> typedef TYPELIST_3(int, long, foo) loki_typelist;
>
> I personally prefer the non-macro form.

As do I.

> As for the rest of the typelist interface I have no opinion. It is the
library implementer
> of visitor, abstract factory, or whatever that needs the rest of the
interface. Of course
> I would care if I were trying to implement a library that depended on
typelists.
> The good news is that this debate is academic for 99.8% of all users
because either
> of the above forms are trivial to understand.

So you're saying that only library writers will ever use MPL or Loki
typelists? I admit
that I have never felt a compelling urge to use them in my own code, but I
think that
has more to do with lack of experience than lack of need. And what I see
over and
over again is that despite the presence of great libraries, people do, in
fact, invent the
wheel many times, and often because the generic wheel is unsuitable for some
corner
case that is not easy to address. In those cases, "end users" become
"library writers"
in some sense. I would imagine those people would like to have nice tools
without
getting a Ph.D in advanced C++ design. ;) For instance, people have already
mentioned creating an uncountable number of smart pointer types because
boost::smart_ptr or Loki::SmartPtr just didn't solve some particular problem
they had,
or at least they didn't see how it could.

If typelist manipulation is something only library writers will ever need to
do, I will
be happy to leave the debate to the library writers. However, it seems to
me that
as generic programming becomes more popular, using typelists in non-library
contexts will only become more common, not less (unfortunately, I'm not
clever
enough to come up with some concrete examples...on the other hand, people
probably couldn't imagine what could be done with OOP when it first came
out,
and probably a few people said that building object hierarchies is the
business of
library writers, and end users only had to understand the resulting
interface).

Dave


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