first, I'm new in this community, so hello everyone (and sorry about my english, I'm from Spain and maybe I'm not speaking well)
Second, I am trying to return an iterator which I have created for a class, but the "return" (I think) is not working properly because the value of the iterator once is returned is random (I checked that before return it is OK)... I don't know why this is happening...
I'll post the code so you can see the whole code of the class and the iterator. I don't know where the error is, and I'm getting mad for 2 days.. The return which I'm talking about is in the function begin() of my class. Line 59 of this code.
The aux vector is created inside the function and will not exist after the function has ended. That means that iterators like it.it_v that refers to that vector is no longer valid after the function has returned.