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.
As a starting point, your value type should be the type of object your container holds. My guess would be either T or T*, you don’t really provide enough information to say. See here for an explanation of what the various parameters mean. The rest can often be left as defaults.