Quote:Original post by Driv3MeFartemplate <typename T>T* Duplicate(T* pIn, int numObjs){ T* ret = new T[numObjs]; std::copy(pIn, pIn + numObjs, ret); return ret;}
EDIT: Fixed bug.
Quote:Original post by Driv3MeFartemplate <typename T>T* Duplicate(T* pIn, int numObjs){ T* ret = new T[numObjs]; std::copy(pIn, pIn + numObjs, ret); return ret;}
Quote:Original post by dalleboyQuote:Original post by Driv3MeFartemplate <typename T>T* Duplicate(T* pIn, int numObjs){ T* ret = new T[numObjs]; std::copy(pIn, pIn + numObjs, ret); return ret;}
EDIT: Fixed bug.
Quote:Original post by janta
@Driv3MeFar: Yeah there is. I'm not coding at home, I'm working on a large codebase like 1M lines of code and I cant afford to refactor everything. The team who originally designed the software made the choice not to use stl.
Quote:That's interesting. Looking at std::copy's signature I saw it required some iterators as inputs, I did not think that mere pointers could be used as iterators. I'll try this, thanks.
Quote:Original post by janta
I've worked in a couple of big professionnal commercial shipped projects and had far more problems with those that used STL that with those that did not. Of course I wouldn't draw any general conclusion from that fact.
Quote:I've worked in a couple of big professionnal commercial shipped projects and had far more problems with those that used STL that with those that did not. Of course I wouldn't draw any general conclusion from that fact.