« first day (2121 days earlier)      last day (307 days later) » 

6:46 PM
hi, i have a std::vector<Particle> particles;

when I access them like Particle p = particles[idx] it seems i get a copy of the original object. Mutations are lost at the end of the scope. Particle *p = &particles[idx] just works fine.

why?
 
1 message moved from Lounge<C++>
 
7:16 PM
anybody know how to get a pointer to the last item in a list?
 
1 message moved from Lounge<C++>
 

« first day (2121 days earlier)      last day (307 days later) »