sure, that doesn't work, but when its used in my function, it works!
It is implementation-defined behaviour and other compilers can do not compile this code. Your compiler compilers this code because it places C-standard functions in the global namespace and you use pow without nested name std::. However as I have said it is not obligatory that an implementation shall place C-standard functions in the global namespace.
No, it doesn't put it in then global namespace! I put using namespace std; at the top of every code. :D
In this case your code shall ot be compiled if you will use objects of type int because the compiler will not know which overloaded function pow to use.