【发布时间】:2009-12-30 13:59:55
【问题描述】:
当我尝试编译时:
#include <boost/fusion/container/map.hpp>
#include <boost/mpl/fold.hpp>
int main(int argc, char** argv)
{
typedef boost::fusion::map
<
boost::fusion::pair<int, const char*>,
boost::fusion::pair<long, char>
> FuMap;
FuMap fuMap("hello", 'w');
unsigned val = boost::mpl::fold
<
FuMap, boost::mpl::int_<0>, boost::mpl::next<boost::mpl::_1>
>::type::value;
}
我收到以下错误:
"...boost/mpl/begin_end.hpp", line 35: Error, nofieldfnd:
apply is not a member of
boost::mpl::begin_impl<boost::fusion::fusion_sequence_tag>.
来自 fusion 文档:“Fusion 提供全轮兼容性 与 MPL。融合序列完全符合 MPL 序列和 MPL 序列与 Fusion 完全兼容。您可以使用 Fusion 如果您只想处理类型,请使用 MPL 上的序列。”
当我通过 boost::mpl::map 时,它可以工作。
有什么线索吗?
【问题讨论】:
标签: c++ boost boost-mpl boost-fusion