正常运行,但是WA。

This commit is contained in:
unlockable
2023-10-07 19:57:41 +08:00
parent 540de5ad77
commit 28fa9faa3f

View File

@@ -98,8 +98,8 @@ public:
// // Returns a sorted NEW list.
// const List<E> sorted(std::function<bool(const E &, const E &)> const
// &isCorrectOrderFunc) const;
Iterator<E> &&iterate();
Iterator<E> &&iterate(int index);
Iterator<E> iterate();
Iterator<E> iterate(int index);
};
// template <class E>
@@ -456,11 +456,11 @@ template <class E> int List<E>::index(const E &target) const {
// const { return List<E>(*this).sort(isCorrectOrderFunc);
// }
template <class E> Iterator<E> &&List<E>::iterate() {
template <class E> Iterator<E> List<E>::iterate() {
return Iterator<E>(this->head);
}
template <class E> Iterator<E> &&List<E>::iterate(int index) {
template <class E> Iterator<E> List<E>::iterate(int index) {
// index = this->getIndexInRange(index);
if (index == 0) {
return Iterator<E>(this->head);