Hi,
(Read the post before looking at the code)
This is the code:
https://gist.github.com/rcktscnc/19990f51b9c14f292b75
I came up with the idea of writing my own "vector" template class to learn a bit more about templates in general. The code I will provide is the best I can write at this moment. The "challenge" here is for more experienced people, not for me.
It is important to note that I have never used the template class vector for anything. I wrote this code trying to make my own vector class, and I never looked at the source of vector. All I know about the vector class is the declaration of its members, not the definition of them. I never even looked at them.
All the algorithms in the code came from my head. I didn't steal code from anywhere.
The Purpose of this Thread: Learning
In this thread, I'm asking to be criticized with the hope of learning something.
RULE 1: No libraries allowed
As the purpose is learning, all I'm using in the code are built in keywords. Except for <iostream> -- which was added for testing and will be removed -- there is no library #included in the project. I wanted it to be as raw as possible.
Challenge 1: GOTTA GO FAST
I would like to get opinions on how this template could be written to run as fast as it possibly can, without using any libraries (not even std). You will notice in the code that I added iostream in the beginning of the file. This is only for testing purposes.
Challenge 2: All about the looks
I would also like to get constructive criticism regarding the style of my code, but in a broader sense. Not only regarding naming conventions, but mainly the logic of the algorithms. Maybe I overcomplicated something that could be more simple, for example. Maybe I repeated code that didn't need to be repeated if I created a function for them etc.. If you find things that are too complicated and could be written in a simple way, please mention it.
The Code: The code is too long to be pasted in this thread, so I pasted it in github:
https://gist.github.com/rcktscnc/19990f51b9c14f292b75
Expectations: The sad truth
The code is very long. Almost 600 lines. Thus, I'm not expecting everyone to read the whole thing (if you do that, great!). But if you want to criticize a particular function, you can do it. Most of the functions work alone. They communicate with other functions rarely. So if you break the code into each function, you can review one function and post in here!
If I don't get any response in here, I'll look for help in another place. No hard feelings!
Thank you!