liam-middlebrook / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Cannot iterate through sequence with BOOST_FOREACH (new API) #159

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following:

#include <boost/foreach.hpp>

BOOST_FOREACH( const YAML::Node &item, node ) // node is a const YAML::Node
{
   cout << YAML::Dump(item) << std::endl;
}

produces the compiler error (on gcc):

/usr/local/include/boost/mpl/eval_if.hpp: In instantiation of 
‘boost::mpl::eval_if<mpl_::bool_<false>, 
boost::range_const_iterator<YAML::Node>, 
boost::range_mutable_iterator<YAML::Node> >’:
/usr/local/include/boost/foreach.hpp:364:   instantiated from 
‘boost::foreach_detail_::foreach_iterator<YAML::Node, mpl_::bool_<false> >’
foreach.cpp:9:   instantiated from here
/usr/local/include/boost/mpl/eval_if.hpp:38: error: no type named ‘type’ in 
‘struct boost::range_mutable_iterator<YAML::Node>’

<snip>

Original issue reported on code.google.com by jbe...@gmail.com on 8 May 2012 at 5:04

GoogleCodeExporter commented 9 years ago
Fixed, r8eb53e550842

(just took a few typedefs!)

Original comment by jbe...@gmail.com on 8 May 2012 at 5:30