c ++ – Adding STL iterator support to a custom collection class – Tracking

I have read the excellent answer to the question Example of adding STL iterator support to the custom collection class on this site; but would also want the iterator class to be a nested class (because of the shared types). The skeleton I want is:

model  RingQueue class
{
...
model  RingIter class {... operations ++, -, ...}
public:
using iterator = RingIter;
using const_iterator = RingIter;
using reverse_iterator = std :: reverse_iterator;
using const_reverse_iterator = std :: reverse_iterator;
... define begin (), end (), ...
};

// this is the line that does not compile!
model class std :: iterator_traits <RingQueue:: RingIter>
{
public:
using difference_type = std :: ptrdiff_t;
using size_type = std :: size_t;
using value_type = TT;
using pointer = TT *;
using reference = TT &;
using iterator_category = std :: random_access_iterator_tag;
};

and it's in this last part that I'm stuck – whatever I tried, I can not extend std :: iterator_traits properly.