Hoping that this is just a dumb mistake on my part. This is my first venture into multithreading, so I don't know what I'm doing.
Here is the code in question (on my red black tree):
pair<unsigned long long, unsigned long long> ALTNode::height() {
pair<unsigned long long, unsigned long long> hl(0,0), hr(0,0), f;
future<pair<unsigned long long, unsigned long long>> l, r;
if (left)
l = async(std::launch::async,left->height());
if (right)
r = async(std::launch::async,right->height());
if (left)
hl = l.get();
if (right)
hr = r.get();
f.first = ((hl.first < hr.first) ? hl.first : hr.first) + 1;
f.second = ((hl.second > hr.second) ? hl.second : hr.second) + 1;
return f;
}
Here is the generated error:
Error 1 error C2664: 'std::pair<_Ty1,_Ty2>::pair(const std::pair<_Ty1,_Ty2> &)' : cannot convert parameter 1 from 'std::_Do_call_ret<_Forced,_Ret,_Funx,_Btuple,_Ftuple>::type' to 'const std::pair<_Ty1,_Ty2> &' G:\Visual Studio 2012\VC\include\xrefwrap 431 1 ALT-Tree
Can you help me out here?
Aucun commentaire:
Enregistrer un commentaire