News for hackers. Stuff that matters.
Re:Strcpycat by nas on Friday January 20, 2012 @10:36PM (#3492513)
Yeah, there might be a few cases were null terminated strings work okay but mostly they are just a recipe for buffer overflows. Seriously, how many years is this going to take to figure out?
Re:Strcpycat by apaprocki on Friday January 20, 2012 @10:56PM (#3492551)
Well move semantics were only introduced in C++11. So until C++11 is supported natively everywhere you can't build something like:

  std::map<std::string, int>
without paying for a extra copy of the string on insertion. How many years since C++ has existed before they finally allowed for a single copy? Everything is relative. You might never have had a need to worry about that double copy, but there are other people who have.
Re:Strcpycat by minimax on Friday January 20, 2012 @11:43PM (#3492623)
As long as you're worrying about the double copy, you may as well worry about chasing the pointers in your map through the cache hierarchy. Usually I'd use unordered_map here unless there was a good reason not to.