Suppose I write a class representing a mathematical object for which it makes sense to define various standard operations.
Overloading arithmetic operators, I enjoy the fact that any template algorithm that uses them will work, as expected, when defining my class. But what if the algorithm uses something like std :: pow?
The standard states that only specialized function templates are allowed in the std namespace, which means that I am not allowed to write my own std :: pow overload for my class. But if this is true, then what is the best approach to ensuring pedigree yet?
source
share