So, i have class ArrayList, and inside, i have class iterator. I tried everything to make operator<< inside iterator class, to work with iterators, but nothing works. I tried with and without friend, in private and public, inline and outside the class, i have nothing else to try so if someone has some suggestion, feel free to say :D tyyy
also, i don't know does it have something with my problem, but ArrayList is template class
template <typename T>
std::ostream& operator<<(std::ostream& os, const ArrayList<T>::iterator & it)
{
return os << *it;
}
template <typename T>
class ArrayList {
private:
T* elements_;
size_t size_;
size_t capacity_;
public:
class iterator;
};
template <typename T>
class ArrayList<T>::iterator {
private:
T* ptr_;
public:
friend std::ostream& operator<<(std::ostream&, const iterator&);
};