c++ - How to support MySet<int>::iterator -


I am doing a practice and facing a problem.
To resolve this practice, I have a template class like code in my CET STL :: Set as the cover, in the following code, like pair and lieutenant; MySasset & lt; Int & gt; :: Iterator, MySet & lt; Int & gt; :: Iterator & gt; P where the pair comes from STL.
Now call me MySet & lt; Int & gt; :: what should be done to support iterator ? I have tried typedef set
and typedef T * iterator but they all failed.

============================== Edit =========== ============================== #include & lt; Iostream & gt; # Include & lt; Set & gt; using namespace std; Template & lt; Square t, square q = big & lt; T & gt; & Gt; Class MySet {Public: Iterator = Type name set & lt; T, Q & gt; :: iterator; Typedef typename set & lt; T, Q & gt; :: Iterator Itater; Set & lt; T, Q & gt; Tset; Insert zero (T value) {tset.insert (value); }}; Int main () {MySet & lt; Int & gt; Intset; Intset.insert (5); Intset.insert (10); MySet & lt; Int & gt; :: Iterator P; }

something like

  template & lt; Class t & gt; Class using MySet {public: // iterator = typename set & lt; T & gt; :: iterator; // If the C ++ 11 Typadf with Typnem Set & lt; T & gt; :: Iterator Itater; // If C ++ 11 // the rest of your code code}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -