You don't know what the function called "add" does either.
There's no reason for the name "+" to be anymore special than "add" - especially in any language supporting unicode identifiers which allows even more crazy names.
There's no reason for the name "+" to be anymore special than "add" - especially in any language supporting unicode identifiers which allows even more crazy names.
> There's no reason for the name "+" to be anymore special than "add"
This is debatable. I want "+" to do just an addition.
Also a function "add", depending on the context, can mean different things.
For the first case, of course you can create something like:
str1.append(str2);
For the second... I don't know what to say.> framing it as a personal preference
But follow my logic for a moment: if "str3 = str1 + str2" concatenates a string, what "str3 = str1 - str2" should do?
(Yes I know there is no minus operator for std::string)
And "str3 = str1 * str2"?
And "str3 = str1 % str2"?