これは修飾子に関するエラーメッセージを表示しますが、それが意味するものとそれが動作するようにコードを調整する方法を実際に理解していませんか?とにかく、コードを見てくれてありがとう。アウトストリーム演算子としてノードを渡す
注:ostream演算子は、Nodeクラスに追加されています。
using namespace std;
ostream& operator(ostream& output, const Node* currentNode)
{
return output;
}
void Node::nodeFunction()
{
//This node has items attached to the 'this' statement. After
//the necessary functions, this is called to output the items.
cout << this;
}
このような観点からはできません。ノード関数自体から各ノードを順番に呼び出すのが最善でしょうか? –