I am curious? What high fundu logic goes behind not implementing:
result+=vector1;
where both result and vector1 are stl vectors.
Note: i know how to implement that bit, but i need to know what logic, the sages who designed STL were using when they chose not to implement this feature?
What are you expecting
resultto contain, the result of concatenating the originalresultwithvector1or an element-wise+=(whatever that means for the underlying types), possibly default-initializing members if the sizes don’t match?And yes, this is an answer 😉 .
Operator overloading should only be used where the meaning of the operation is unambiguous and practical for the underlying type and where it would offer a significant notational brevity over appropriately named function calls.
Note that
valarrayhas more operator overloads thanvectordue to its interface and intended use.