Articles contenant le tag move-semantic

Moving an object that wraps a vector and an iterator on that vector

I recently stumbled upon code that looked very suspicious to me. Basically, it was a class which amongst other things held a vector and some iterators from that vector. Something like this: struct Wrapper {     typedef std::vector<int> Data;     Data data;     Data::iterator active;     Wrapper() :         data(),         active(data.end())     { } […]

, ,

Pas de commentaire