Hi,
Than you for the quick reply :) Now I reimplemented
intersect by converting the type sequences to mpl::set
and do a mpl::has_key instead of mpl::contains:
template
on Sun Jun 10 2007, Andrej van der Zee
wrote: Hi,
Sorry if this already has been posted, but I have a problem with compile-time performance when trying to get the intersection of two type sequences. For example, when I do something like this:
template
struct intersect { typedef typename boost::mpl::remove_if ::type type; };
typedef mpl::vector l1; typedef mpl::vector
l2; typename intersect
::type my_intersection; Then for large type sequences compile-time becomes unacceptable (O(M*N)).
I'm surprised it's even that good, since most compilers have such poor performance for multiple instantiations of the same template. That's the cost you'd expect for a direct runtime translation of your algorithm.
Is there a better way to do this?
I'd use an associative sequence like mpl::set.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
___________________________________________________________ Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm...