I am about to "create" my own vector class for a library I am writing. I won't really create a vector class from scratch, but just use std::vector
as a parent class and add some stuff to my derived vector class.
Now, that said, I need a bit of advice. My questions are:
1) Is it a bad idea to call my derived class vector
(inside of another namespace, of course)? What kind of conflicts will I have in this case?
2) I want to overload the math operators to be able to add vectors, multiply vectors by constants etc. This is actually the reason why I decided to build a vector class on top of std::vector
. I could, however, overload the math operators for std::vector
directly and save myself the trouble of creating (yet another...) vector class -- but is this a bad idea?
3) I would very much like to inherit the constructors from std::vector
, but I am having lots of trouble getting this done without compiler errors. Could someone please provide me with a concrete example showing me how can this be done?
Thank you!