私の前の質問に続いて、 保護されたメンバーは派生クラスでは不明です
その行のどの部分が間違っているのか理解できません。
ここにコンパイルエラーがあります:
template <typename K, typename T>
bool graph<K, T>::is_edge(const K& k1, const K& k2)
{
if (this->nod.find(k1) == this->nod.end() || this->nod.find(k2) == this->nod.end())
throw std::string("is_edge: Node does not exist");
if (k1 < k2) // Below line makes error: expected primary-expression!!!!
return std::find(this->edg.begin(), this->edg.end(), edge(k1, k2)) != this->edg.end();
return std::find(this->edg.begin(), this->edg.end(), edge(k2, k1)) != this->edg.end();
}
または、このステートメントの何が問題なのですか:
std::find(this->edg.begin(), this->edg.end(), edge(k1, k2)) != this->edg.end();
完全なコードはここにあり、ここでテストおよびコンパイルできます。