It's a question about c++

Asked 2 years ago, Updated 2 years ago, 35 views

one iterator node the class list trying to get inside. But nothing but a shell of the class iterator and (The public and the private iterator nodelist class in.) the Roman trying to use. * node iterator For example, by the operator overloading node. ; * a To put arguments in the arguments to the middle, and guyeonbu to use ; a can you? Further explanation.~ 만약 iterator 클래스를 사용하면 Iterator a; 이렇게 정의하고 operator *() overloading 에의해 cout<<a<<endl을 사용하면 a의 elem이 나오는데 Iterator 를 사용하지 않고 Node* a; 로 사용하고 싶습니다~

c++

2022-09-22 17:56

1 Answers

NodeList and Iterator classes have different roles. Currently, these classes are designed quite close to the standard, is there any special reason to eliminate the Iterator class?

If you want to replace Iterator with Node*, you can implement operator overloading for structure nodes rather than putting the Iterator implementation into the NodeList class.


2022-09-22 17:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.