I've been having a poke around in the boost source code
boost/mpl/set/aux_/iterator.hpp
and I've found that if I tweak the partial specialization
template
struct next< s_iter< Set, Tail > >
: s_iter_get< Set, typename Tail::base >
{
};
to
template
struct next< s_iter< Set, Tail > >
{
typedef typename s_iter_get< Set, typename Tail::base >::type type;
};
Then everything works fine on solaris S1S12u1.
Is there a problem with S1S12u1 wrt to deep metafunction forwarding?
Is this a suitable workaround?
I've still not figured out why the boost::mpl::copy works ok with sets ( surely they will also have to use s_iter_get during the fold ) - I'm assuming that the views 'invokes' boost::mpl::next in such a way which isn't supported by the compiler.
From: chamber_j@hotmail.com
To: boost-users@lists.boost.org
Subject: Problems with copying view on mpl set on solaris compiler.
Date: Mon, 22 Mar 2010 12:57:58 +0000
I'm trying to get the following to compile on solaris using S1S12u1;
#include
#include
#include
#include
#include
#include
#include
typedef
boost::mpl::copy<
boost::mpl::filter_view<
boost::mpl::set<int>,
boost::is_same
>,
boost::mpl::inserter<
boost::mpl::set<>,
boost::mpl::insert
>
>::type type;
template <class undefined>
struct Debug;
Debug<type> debug;
int main(int argc, char *argv[])
{
return 0;
}
and I get the following compiler errors
"boost_1_42_0/boost/mpl/aux_/filter_iter.hpp", line 66: Error: Redefining boost::mpl::nextboost::mpl::T after use in boost::mpl::aux::filter_i
ter, boost::mpl::s_item>>, boo
st::mpl::s_iter, boost::mpl::set0>, boost::mpl::protect, mpl_::void_>, mpl_::arg<-1>, int>, 0>>.
"boost_1_42_0/boost/mpl/next_prior.hpp", line 31: Where: While specializing "boost::mpl::aux::filter_iter, boost::mpl::s_item>>, boost::mpl::s_iter, boost::mpl::set0>, boost::mpl::protect, mpl_::void_>, mpl_::arg<-1>, int>, 0>>".
"boost_1_42_0/boost/mpl/next_prior.hpp", line 31: Where: Specialized in boost::mpl::next, boost::mpl::s_item>>, boost::mpl::s_iter, boost::mpl::set0>, boost::mpl::protect, mpl_::void_>, mpl_::arg<-1>, int>, 0>>>.
"boost_1_42_0/boost/mpl/aux_/preprocessed/plain/fold_impl.hpp", line 162: Where: Specialized in boost::mpl::aux::fold_impl<-1, boost::mpl::a
ux::filter_iter, boost::mpl::s_item>>, boost::mpl::s_iter, boost::mpl::set0>, boost::mpl::protect, mpl_::void_>, mpl_::arg<-1>, int>, 0>>, boost::mpl::aux::filter_iter, boost::mpl::set0>, boost::mpl::s_iter, boost::mpl::set0>, boost::mpl::protect, mpl_::void_>, mpl_::arg<-1>, int>, 0>>, boost::mpl::set, boost::
mpl::insert, mpl_::arg<-1>, mpl_::na>>.
"boost_1_42_0/boost/mpl/fold.hpp", line 39: Where: Specialized in boost::mpl::fold, boost::is_same, int>>, boost::mpl::set, boo
st::mpl::insert, mpl_::arg<-1>, mpl_::na>>.
"boost_1_42_0/boost/mpl/copy.hpp", line 36: Where: Specialized in boost::mpl::aux::copy_impl, boost::is_same, int>>, boost::mpl::inserter, boost::mpl::insert, mpl_::arg<-1>, mpl_::na>>>.
"boost_1_42_0/boost/mpl/copy.hpp", line 54: Where: Specialized in boost::mpl::copy, boost::is_same, int>>, boost::mpl::inserter, boost::mpl::insert, mpl_::arg<-1>, mpl_::na>>>.
"filter_view.cpp", line 19: Where: Specialized in non-template code.
"filter_view.cpp", line 24: Error: In this declaration "debug" is of an incomplete type "Debug
".
2 Error(s) detected.
You can see by the debug that the program has managed to deduce the correct type, even though it errored.
On GCC-4.1.1 this gives
filter_view.cpp:24: error: aggregate 'Debug > > debug' has incomplete type and cannot be defined
Which is exactly what I want.
Anyone else had these issues, found workarounds, etc?
This problem also occurs with boost::mpl::transform_view, but appears to work for boost::mpl::joint_view.
Any help appreciated.
Jon.
Do you have a story that started on Hotmail? Tell us now
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/