我在STL的
numeric
头文件中找到了计算power(TYPE T, Integer a)
,时间复杂度为O(log(a))的函数power
,但是当我写完并使用g++
编译时,出现了编译错误,提示error: ‘power’ was not declared in this scope
。为什么会这样?我知道编写时间复杂度为O(log(N))的power函数很容易,但我想知道C++标准库中是否有现成的函数。C++11标准中是否添加了任何功能?