我正在尝试使用 bit_ceil(),我包含了 < bit > 标头,并使用了 std 命名空间(我知道这不是一个好的做法,但我在这里这样做是为了解决问题)
但是当我尝试使用该函数时,它只会引发错误
'bit_ceil' was not declared in this scope
#include<iostream>
#include <bit>
using namespace std;
int main ()
{
int x = 1;
x = bit_ceil(x);
}
奇怪,有人有想法吗?
有关此功能的问题在互联网上很少见。
这是 C++20 中引入的内容,因此您需要在命令行中添加(如果使用 GCC)
-std=c++20