The probable historical motive is because neither does C. And it does not have, because originally it was not thought to perform many mathematical operations.
Remember that the language was created to write an operating system and not solve scientific problems. Remember that the language aimed to improve the Assembly, who did not possess it as instruction.
In addition, the machines of that time were simple and probably not worth creating an operator. Nor was it a common operation. It was very easy to burst the values that the processor worked naturally, complicating the algorithms in such a way that the function gave in the same.
It has already been discussed the possibility of creating the operator for C++, there are not enough advantages to introduce in the language that is already complicated. It is not as trivial to implement it as it may seem, at least not in a language with this history.
If only the syntax matters, it is possible to create it:
template<typename T>
T operator^(T x, T y) {
return std::pow(x, y);
}
I put in the Github for future reference.
You need to know if you should, you’re killing the XOR. And keep an eye on the precedence table of it. It might get weird.
Did any help you more? You need something to be improved?
– Maniero