I'm currently trying to overload the +
operator in order to combine two arrays of type T
, but I've been hitting a wall for the last hour or so .
I want to do this without making any use of stl
because I'm a beginner in C++
and I want to get a good grip on implementing classes before using the standard ones .
The context would be that I'm currently designing a vector
class of my own by using a templated dynamically allocated array.
Therefore, what I'm interested in at this point is overloading the +
operator so that when performing c = a + b
inside the main function , where a , b , c
are Vector<T>
objects, c
would become the combination of those two ( concatenation ) .
I can't really wrap my mind around this, since the function that defines the behaviour of the operator can handle at most one parameter .
Can anyone suggest any ideas ?