I have a class _vector which I want to replace by std::vector in all instances of the code without manually changing the literal text of it. In a way, i want to replace the functionality of std::vector with a custom one which is a derived class of it.
My custom class is a one template parameter class which inherits from std::vector<T> where I implemented additional operator[] functionality. I want to replace all the std::vectors in the code by the custom one.
I tried to do
template <class T>
using vector = _vector<T>;
But when creating a std::vector it says that the call is ambiguous, which makes sense.
I also tried to use typedef in all posible combinations involving templates, with no avail, like so
template <class T>
typedef _vector<T> vector<T>;
I also tried to define std::vector as _vector, using
#define vector _vector
But it changes all the implementations of std::vector in _vector, even if I put this line after the class definition, as it is a preprocessor directive and is ran before compiling it.
I don't what more to do, and if someone has an answer, please share it. Thanks.
