A
Alexander Stippler
Hi,
I've got a question concerning iterators. I'm writing some container class
and iterators upon it. I have to have
typedef typex pointer;
typedef typey reference;
to be standard conforming. But what semantic requirements does the standard
expose on type typey (and typex). If I define
reference operator*(),
does the object I return have to be (non-const) referencable or can I return
a temporary object of typey? If I'm not allowed to, how can I write some
iterator and especially operator*(), if I have to create its result on the
fly? I hope, I made my question understandable.
regards,
alex
I've got a question concerning iterators. I'm writing some container class
and iterators upon it. I have to have
typedef typex pointer;
typedef typey reference;
to be standard conforming. But what semantic requirements does the standard
expose on type typey (and typex). If I define
reference operator*(),
does the object I return have to be (non-const) referencable or can I return
a temporary object of typey? If I'm not allowed to, how can I write some
iterator and especially operator*(), if I have to create its result on the
fly? I hope, I made my question understandable.
regards,
alex