code of my two template class Errors
Ive tried using "friend class" declaration instead of "friend". replacing "friend" with "friend class"
The errors is caused by creating a Mydeque object within main.
template <typename T>
class Mydeque
{
private:
T* data;
int cap, sz;
friend class Iterator<T>;
public:
Mydeque(): cap(0), sz(0) //Constructor
{
//do nothing
}
};
template<class T>
class Iterator
{
public:
private:
size_t current;
Mydeque<T>* container;
friend class Mydeque<T>;
};