Код: Выделить всё
#ifndef DIRECTED_GRAPH_NODE_H
#define DIRECTED_GRAPH_NODE_H
#include
#include
#include
#include
#include
class DirectedGraphNode;
class DirectedGraphNode {
private:
std::size_t m_id;
std::unordered_set* m_neighbors;
public:
DirectedGraphNode(std::size_t id)
: m_id{ id }
, m_neighbors{ new std::unordered_set} {}
std::unordered_set* getNeighbors() {
return m_neighbors;
}
void addNeighbor(DirectedGraphNode& neighbor) {
m_neighbors->insert(&neighbor);
}
bool operator==(DirectedGraphNode* other) {
return m_id == other->m_id;
}
friend std::ostream& operator
Подробнее здесь: [url]https://stackoverflow.com/questions/78646927/resolving-cyclic-dependencies-in-class-definitions[/url]