template <int p>
bool FComapare (Node *lId, Node* rId)
{
if(lId->getDiff(p) < rId->getDiff(p))
return true;
else if(lId->getDiff(p) == rId->getDiff(p))
{
if(lId->getLT() < rId->getLT())
return true;
else if(lId->getLT() == rId->getLT())
return (lId->getTFG() < rId->getTFG());
}
return false;
}
vector<set<Node*, bool (*)(Node*,Node*) > > m_F;
for (int i = 0;i < partNum; ++i)
{
//This doesn`t workbecause of const problem...
set<Node *, bool (*)(Node*,Node*) > f(&FComapare<i>);
m_F.push_back(f);
}
私は次のようなエラーにテンプレートメタプログラミングの問題
error C2664: 'std::set<_Kty,_Pr>::set(bool (__cdecl *const &)(Node *,Node *))' : cannot convert parameter 1 from 'bool (__cdecl *)(Node *,Node *)' to 'bool (__cdecl *const &)(Node *,Node *)' 1> with 1> [ 1>
_Kty=Node *, 1> _Pr=bool (__cdecl *)(Node *,Node *) 1> ] Reason: cannot convert from 'overloaded-function' to 'bool (__cdecl *const)(Node *,Node *)' 1>
None of the functions with this name in scope match the target type
どのように問題を解決し、同じ機能を得ることができますを取得していますか? はどうすれば
「どのように問題を解決して同じ機能を利用できますか?」 - どのような機能ですか?まず最初にどのような機能を望んでいるのか忘れてしまいました。ここで何を達成しようとしていますか? –