hkaiser changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar-group.org | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | This channel is logged: irclog.cct.lsu.edu
<dkaratza[m]>
<hkaiser> "dkaratza: I comitted a minor..." <- Much appreciated, I will take a look
<gonidelis[m]>
tryina figure out an arbitary iterator's constructor ` _iterator(T* ptr) : ptr(ptr) {}` where `private: T* ptr;`
<gonidelis[m]>
hkaiser: but the counting_output_iterator we checked has a `private: T& count;`
<gonidelis[m]>
what's the difference between keeping T& and T*? I reckon since it's a counting iterator it needs to keep a reference to the counter (for it to be concise) while the generic iterator impl. just keeps a pointer to the given data type ptr....
<gonidelis[m]>
(just thinking out loud here)
<gonidelis[m]>
NO ASSIGNMENT OPERATOR REQUIRED? 0.0
<hkaiser>
gonidelis[m]: holding a T& prevents copying the object
<gonidelis[m]>
how?
<gonidelis[m]>
it's just a reference to the internal counter
<hkaiser>
what should happen when you try to copy a struct A { int& foo; };? you can copy construct such a thing, but not copy assign
<hkaiser>
the workaround is to hold a pointer
hkaiser has quit [Quit: Bye!]
<gonidelis[m]>
!
<gonidelis[m]>
correct!
<gonidelis[m]>
and what's the difference of an operatorX returning a reference_type and returning an iterator&
<gonidelis[m]>
one returns a reference to the pointed data the other returns a reference to the iterator object itself?