int main(int argc, char *argv[]) { //std::back_insert_iterator<std::vector<double> > a; //std::back_insert_iterator<double> a; std::vector<double> MyVector; std::back_insert_iterator<std::vector<double> > MyIterator(MyVector); return 0; }
typename QueapTree<T>::MyIterator QueapTree<T>::begin() { TreeNode<T>* pointer = root_; while(pointer->count_!=-1) { pointer = pointer->child_[0]; } return MyIterator(pointer->parent_,height_); }
typename QueapTree<T>::MyIterator QueapTree<T>::end() { return MyIterator(nullptr,1); }
#include <iostream> class MyClass { public: class MyIterator { public: const MyIterator& operator++(int) const; private: static const MyIterator END; }; }; using MyIterator = MyClass::MyIterator; //**QUESTION: I've already used the class, why did the nested MyIterator class not get recognized?** // the following line is the definition of the static const object const MyIterator MyIterator::END = MyIterator(); //error: ‘MyIterator’ does not name a type const MyIterator& MyIterator::operator++(int) const { return MyIterator::END; } int main() { }