How to correctly inherit std::iterator.

Posted by Knowing me knowing you on Stack Overflow See other posts from Stack Overflow or by Knowing me knowing you
Published on 2010-04-23T18:09:46Z Indexed on 2010/04/23 18:13 UTC
Read the original article Hit count: 183

Filed under:
|

Guys if I have class like below:

template<class T>
class X
{
T** myData_;
public:
class iterator : public iterator<random_access_iterator_tag,/*WHAT SHALL I PUT HERE? T OR T** AND WHY?*/>
{
T** itData_;//HERE I'M HAVING THE SAME TYPE AS MAIN CLASS ON WHICH ITERATOR WILL OPERATE
};
};

Questions are in code next to appropriate lines.
Thank you.

© Stack Overflow or respective owner

Related posts about c++

Related posts about iterator