私はこのコードを持っています:
if (((boost::get< 1>(*i)) == node1) || ((boost::get< 2>(i*)) == node2))
{
cout << "on this tuple "<< boost::get<1>(*i) << "we found it" << endl;
}
そして、私にこのエラーを与えています、それが何について話しているのか考えてください:
main.cpp:172: error: expected primary-expression before ‘)’ token
これは、次のように、タプルのベクトルをチェックして、どれが値を持つかを知ることです。
void threaded_function(Model_factory &mf, ppa::Node *root)
{
boost::mutex::scoped_lock lock(result_mutex);
if(!running_jobs.empty())
{
boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool> tuple = running_jobs.front();
cout << "getting the lock for " << running_jobs.front() << " on "
<< lock.owns_lock() << endl;
running_jobs.pop();
lock.unlock();
ppa::Node *n = boost::get<0>(tuple);
ppa::Node *n1 = boost::get<1>(tuple);
ppa::Node *n2 = boost::get<2>(tuple);
bool check = boost::get<3>(tuple);
// n2->start_alignment_new(&mf);
//n1->start_alignment_new(&mf);
cout << " name " << n->get_name() << " has seq" << n->node_has_sequence_object<< " " << n->left_child->get_distance_to_parent()
<< " " << n->right_child->get_distance_to_parent() << " this done = " << check << endl;
n->start_alignment_new(&mf);
cout << " name " << n->get_name() << " has seq " << n->node_has_sequence_object<< " " << " lock " << lock.owns_lock() << endl;
boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool> tuple2 = wait.front();
ppa::Node *node = boost::get<0>(tuple2);
ppa::Node *node1 = boost::get<1>(tuple2);
ppa::Node *node2 = boost::get<2>(tuple2);
bool check2 = boost::get<3>(tuple);
typedef vector<boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool> >::iterator vec_iter;
for (vec_iter i = wait.begin(); i != wait.end(); ++i)
{
if (((boost::get< 1>(*i)) == node1) || ((boost::get< 2>(i*)) == node2))
{
cout << "on this tuple "<< boost::get<1>(*i) << "we found it" << endl;
}
else
{
cout << "false found" << endl;
}
}
}