A friend of mine is having problems using setc with for_each. Given
the following code:
struct p
{
template<typename T>
void operator()(T) const
{ std::cout << typeid(T).name() << std::endl; }
};
typedef mpl::vector_c vc;
typedef mpl::set< mpl::integral_c, mpl::integral_c > si;
typedef mpl::set_c sc;
int main()
{
mpl::for_each<vc>(p());
mpl::for_each<si>(p());
mpl::for_each<sc>(p()); // line does not compile
}
Under gcc 4.0.1 and Boost 1.38.0, we get the following error messages
for the line in question:
boost/mpl/next_prior.hpp:30: error: no type named 'base' in 'struct
boost::mpl::set0_c<int>'
boost/mpl/eval_if.hpp:38: error: no type named 'type' in 'struct
boost::mpl::next >'
boost/mpl/for_each.hpp:78: error: 'value' is not a member of
'<declaration error>'
boost/mpl/for_each.hpp:78: error: 'execute' is not a member of
'<declaration error>'
Is this a misunderstanding on how to use for_each and set_c on our part?
Regards,
--
Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404