Far*_*zam 3 c++ algorithm stl numeric c++11
我power在numeric标题中找到了STL ,它power(TYPE T, Integer a)在O(log(a))中计算,但是当我编写它并用g++它编译它时给了我编译错误并说error: ‘power’ was not declared in this scope.为什么会这样?我知道编写在O(log(N)中计算的幂函数很容易买到我想知道C++的标准库中是否有就绪函数.C++ 11标准中没有添加任何功能吗?
power
numeric
power(TYPE T, Integer a)
g++
error: ‘power’ was not declared in this scope
Bjö*_*lex 7
从您链接的页面:
该功能是SGI扩展; 它不是C++标准的一部分.
虽然SGI文档通常很有帮助,但请注意它与标准有一些偏差.
Mik*_*our 7
该功能在SGI的原始STL中,但不在标准库中.
在GNU库中,它可以作为扩展,__gnu_cxx::power在<ext/numeric>.
__gnu_cxx::power
<ext/numeric>
ken*_*ytm 5
没有std::powerC++ 11中没有或类似的算法.
std::power
归档时间:
14 年,4 月 前
查看次数:
1011 次
最近记录:
14 年,3 月 前