Skip to main content
4 events
when toggle format what by license comment
Aug 24, 2010 at 8:05 comment added Erik Engheim Thanks for the tip about std::copy memcpy. I didn't know that. When Alexandrescu treated this some years ago it was not the case. About C++ iterators. It is mainly about the philosophy, I try to program how C++ was meant to be program both for the sake of people I work with and to take advantage of C++ features. It was mainly made to point out that some C++ improvements like STL containers are not always better than doing it in the old C way.
Aug 23, 2010 at 19:15 comment added BRaffle Also, RE: STL vector vs plain arrays, why not use the nice parts of vector and use normal C pointers instead of iterators if you don't like them? You can just do &myvector[N]. It's like the best of both worlds, assuming your C code does memory allocation the same way. Or, in for loops, check out BOOST_FOREACH. Makes it even simpler than C.
Aug 23, 2010 at 19:08 comment added BRaffle FYI, in every instance that I've checked (which is, I think, darwin gcc and vc2008), std::copy will just compile to a call to memcpy if both types are POD.
Aug 23, 2010 at 15:39 history answered Erik Engheim CC BY-SA 2.5