I felt like sharing this, I just made a array class for my Engine and it's as close as I code get to stl vector. I did this to familiarise myself with templates and such. Feel free to make suggestions, or borrow ideas from it. I lost the file data from a power cut, but I managed to write it again in a couple of minutes so I think I got templates down
Hey awesome, are you going to use it too or was it just for knowledge? I think your push_back function might be really inefficient though. I believe the way the STL does it is by doubling the current capacity when the need for more capacity arises.
X Abstract X wrote:Hey awesome, are you going to use it too or was it just for knowledge? I think your push_back function might be really inefficient though. I believe the way the STL does it is by doubling the current capacity when the need for more capacity arises.
Both, hmm ok well I was under the impression that push_back() makes room for one more element hehe
STL is kinda iffy on embedded systems IIRC, so if I ever do anything like that I could benefit from my own array class (: (:
I should do more stuff like this, to get myself up to speed after a large break from hobbyist programming.
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
--------------------------------------------------------------------------------------- And now a joke to lighten to mood :D
I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P