返回首页

您好,

只是玩弄有用BOOST_FOREACH的循环。我遇到了一个语法问题


std::vector < std::pair < int, int > > aa;

BOOST_FOREACH(std::pair<int,int>   ptr, aa)

{

              std::cout  << "hello";

}


编译错误

{C}为什么觉得我在3个参数传递和正确的语法应该是得到我迭代正确?
我知道向量是空的,但我只想对BOOST_FOREACH的循环语法的权利。

我要补充一点,如果我有

 std::vector<std::pair <int, int> >::iterator  anything;

它编译的罚款,但我觉得BOOST_FOREACH的你不包含的std :: vector位。

感谢您的任何输入

回答

评论会员: 时间:2