A
agentprog
Hello!
I have a container class, its structure is implemented using private structure. And i would like to implement something like iterator and it should be able to have a pointer to that private structure.
class Container {
public:
// ...
class Iterator {
// ...
private:
//Container::node *ptr;
node *ptr;
};
private:
struct node {
// ...
};
// ...
};
Compiler does not allow me to do that even if Iterator is a friend of Container.
Is there a way to access Container::node from Container::Iterator or maybe i should rethink the whole design?
If it makes sense, i use g++ (4.6.3) as a compiler in c++03 standard mode.
I have a container class, its structure is implemented using private structure. And i would like to implement something like iterator and it should be able to have a pointer to that private structure.
class Container {
public:
// ...
class Iterator {
// ...
private:
//Container::node *ptr;
node *ptr;
};
private:
struct node {
// ...
};
// ...
};
Compiler does not allow me to do that even if Iterator is a friend of Container.
Is there a way to access Container::node from Container::Iterator or maybe i should rethink the whole design?
If it makes sense, i use g++ (4.6.3) as a compiler in c++03 standard mode.