我已经使用boost::variant<string, float>
. 但是,当我尝试boost::any
改用时,我在指令中遇到不匹配操作数错误,cout<<
这段代码是:
for( vector<vector<vector<boost::any>>>::const_iterator i = masterList.begin(); i != masterList.end(); ++i)
{
for( vector<vector<boost::any>>::const_iterator j = i->begin(); j != i->end(); ++j)
{
for( vector<boost::any>::const_iterator k = j->begin(); k != j->end(); ++k)
{
cout<<*k<<' ';
}
}
}