|
Boost Users : |
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2007-03-16 19:22:08
Funny, but my girl friend just found the book in the shelf. On page 45-46 is
an example with the quantities type checking. It relies on the mpl equal
algorithm:
http://www.boost.org/libs/mpl/doc/refmanual/equal.html
It can test if two sequences have elements of the same type ;). But I have a
feeling, that I misunderstand you. Would you like to check if TypeList2 have
the elements of same type as TypeList1 or would you like to find out if
TypeList2 is a subsequence of TypeList1, which can start somewhere in the
middle of TypeList1 and go until the end?
If you are looking for a susequence implementation it should not be so
difficult to implement the contains meta function :). You can operate on
iterator ranges and decide if one vector is a subsequence of another.
mpl::iterator_range is also a model of forward, bidirection and random
access sequence, so you can operate on that the subsequence vector and
equal.
Just in addition: I like the following doc link a lot:
http://www.boost.org/libs/mpl/doc/refmanual/refmanual_toc.html
Here you can find structured reference of supported mpl data structures and
algorithms with examples.
With Kind Regards,
Ovanes
-----Original Message-----
From: Scott Meyers [mailto:usenet_at_[hidden]]
Sent: Freitag, 16. März 2007 23:48
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [MPL] 2 Newbie Questions
Ovanes Markarian wrote:
> Try out:
>
> #include <boost/mpl/bool.hpp>
> #include <boost/mpl/assert.hpp>
> #include <boost/mpl/or.hpp>
Missing #includes! Sigh. There's no <boost/mpl.hpp> to get everything, is
there?
Thanks for your help. They don't get much newbier than that, do they?
Sounds like I'll have to write contains<TypeList1, TypeList2> myself, huh?
Scott
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net