|
Boost Users : |
Subject: Re: [Boost-users] mpl::set and mpl::fold
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-09-01 10:54:50
AMDG
Paul Graphov wrote:
> I've encountered a problem while using mpl::fold with mpl::set
>
> I've defined a template to check if one sequence contains all elements of
> the other:
>
> namespace mpl = boost::mpl;
> template<class A, class B>
> struct subset
> : mpl::fold<
> A,
> mpl::true_,
> mpl::and_<mpl::_1, mpl::contains<B, mpl::_2> >
> >
> {};
>
> It works fine with lists and vectors but when first template parameter (A)
> is set or set_c
> it fails to compile. Did I miss something? Why is it impossible to iterate
> through a set via fold?
>
It looks like fold is trying to increment past the end of the sequence.
It works for me with the trunk with set, but not with set_c. I think the
problem is that end<> is broken for set_c.
In Christ,
Steven Watanabe
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