[C] ubuntu /usr/include/c++/11/ 下的文件报错

主要是这几个错误

/usr/include/c++/11/bits/uniform_int_dist.h:284:71: error: call to non-‘constexpr’ function ‘static uint64_t omp::XoroShiro128Plus::min()’
284 | constexpr __uctype __urngmin = _UniformRandomBitGenerator::min();

/usr/include/c++/11/bits/uniform_int_dist.h:285:71: error: call to non-‘constexpr’ function ‘static uint64_t omp::XoroShiro128Plus::max()’
285 | constexpr __uctype __urngmax = _UniformRandomBitGenerator::max();

/usr/include/c++/11/bits/uniform_int_dist.h:286:34: error: non-constant condition for static assertion
286 | static_assert( __urngmin < __urngmax,

下面是完整信息
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/CombinedRange.o omp/CombinedRange.cpp
In file included from /usr/include/c++/11/bits/stl_algo.h:66,
from /usr/include/c++/11/algorithm:62,
from omp/CombinedRange.cpp:4:
/usr/include/c++/11/bits/uniform_int_dist.h: In instantiation of ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomBitGenerator = omp::XoroShiro128Plus; _IntType = long unsigned int; std::uniform_int_distribution<_IntType>::result_type = long unsigned int]’:
/usr/include/c++/11/bits/stl_algo.h:3791:35: required from ‘void std::shuffle(_RAIter, _RAIter, _UGenerator&&) [with _RAIter = __gnu_cxx::__normal_iterator<omp::CombinedRange::Combo*, std::vector<omp::CombinedRange::Combo, omp::AlignedAllocatoromp::CombinedRange::Combo > >; _UGenerator = omp::XoroShiro128Plus&]’
omp/CombinedRange.cpp:101:17: required from here
/usr/include/c++/11/bits/uniform_int_dist.h:284:71: error: call to non-‘constexpr’ function ‘static uint64_t omp::XoroShiro128Plus::min()’
284 | constexpr __uctype __urngmin = _UniformRandomBitGenerator::min();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from omp/CombinedRange.cpp:3:
omp/Random.h:32:21: note: ‘static uint64_t omp::XoroShiro128Plus::min()’ declared here
32 | static uint64_t min()
| ^
In file included from /usr/include/c++/11/bits/stl_algo.h:66,
from /usr/include/c++/11/algorithm:62,
from omp/CombinedRange.cpp:4:
/usr/include/c++/11/bits/uniform_int_dist.h:285:71: error: call to non-‘constexpr’ function ‘static uint64_t omp::XoroShiro128Plus::max()’
285 | constexpr __uctype __urngmax = _UniformRandomBitGenerator::max();
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from omp/CombinedRange.cpp:3:
omp/Random.h:37:21: note: ‘static uint64_t omp::XoroShiro128Plus::max()’ declared here
37 | static uint64_t max()
| ^
In file included from /usr/include/c++/11/bits/stl_algo.h:66,
from /usr/include/c++/11/algorithm:62,
from omp/CombinedRange.cpp:4:
/usr/include/c++/11/bits/uniform_int_dist.h:286:34: error: non-constant condition for static assertion
286 | static_assert( __urngmin < __urngmax,
|
~~~~~~^~~~~~~~~
make: *** [<builtin>: omp/CombinedRange.o] Error 1

发表回复

您的电子邮箱地址不会被公开。