I'm writing a collection of containers and iterators for an environment where STL and Boost are off the table. I'm struggling somewhat with dealing with containers, such as a Vector, that can contain both value types and pointer types, when it comes to handling iterators and their return types - via a GetValue function, for example. It is further complicated by wanted to support const iterators. I have seen here about the definition of a series of traits: value_type, reference, pointer. My question is how are these used in the context of creating iterators? Essentially, given that I want
Object & Vector<Object>::Iterator::GetValue()
Object * Vector<Object*>::Iterator::GetValue()
const Object & Vector<Object>::ConstIterator::GetValue()
const Object * Vector<Object*>::ConstIterator::GetValue()
How do value_type, reference, pointer factor into this?