Boost logo

Boost :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2005-08-02 12:26:40


David Abrahams wrote:
[snip]
> Why are you requiring that the user pass mpl::list<> as opposed to
> some other mpl sequence?

I need to modify that sequence internally. If any sequence was allowed
(including immutable ones), I would need to copy that sequence into an
mpl::list<> first. I suspect that the copying slows down compilation
noticeably (I never had the chance to make measurements, so this may
well be FUD), so I figured that requiring a list is the best way to give
the user the opportunity to keep compilation as fast as possible. Sure,
I could make a copy only if the user doesn't pass an mpl::list<> and
document that in the interface but nobody has ever made a request in
this direction. I guess this is due to the fact that pretty much
everybody specifies the InnerInitial states inline:

struct Y;
struct Z;
struct X : sc::simple_state< X, Machine, mpl::list< Y, Z > > {};

That is, I can't really think of a real-world example where you would
want to use an algorithm to fill that list...

Would you allow any mpl sequence anyway?

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header.
 

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