Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2002-04-10 16:33:03


D. Held wrote:

> perhaps it would help if MPL
> could be demonstrated in contexts where Loki::typelist has already
> been used. This way, people can see A) that MPL is just as easy to
> use, and provides more power on top of that, B) that MPL is not
> necessarily as easy to use, but the additional power justifies the
> difficulty, or C) that Loki::typelist does indeed fill a niche for
> ease-of-use that MPL does not offer.

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 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.

Jeff


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