与元组我有这个代码
for (std::vector<std::tuple<uint32, std::string, uint32> >::const_iterator ixn = messages.begin(); ixn != messages.end(); ++ixn)
{
if (std::get<0>(ixn) == user->getID() && std::get<1>(ixn) == msg && std::get<2>(itr) > time)
{
//some doin
}
}
并说它
no matching function for call to ‘get(std::vector<std::tuple<long unsigned...
答案 0 :(得分:1)
您需要使用(* ixn)取消引用迭代器。您的最后一个迭代器也称为itr
而不是ixn
。
for (std::vector<std::tuple<uint32, std::string, uint32> >::const_iterator ixn = messages.begin(); ixn != messages.end(); ++ixn)
{
if (std::get<0>(*ixn) == user->getID() && std::get<1>(*ixn) == msg && std::get<2>(*ixn) > time)
{
//some doin
}
}