未验证 提交 8a1b998b 编写于 作者: V Vincent Rabaud 提交者: GitHub

Merge pull request #24194 from vrabaud:compilation_fix

* Fix compilation when forcing later C++.

* Remove random_shuffle.

* Remove random_shuffle.
上级 588ddf1b
......@@ -264,7 +264,8 @@ TEST(Objdetect_QRCode_Encode_Decode, regression)
int true_capacity = establishCapacity(mode, version, cur_capacity);
std::string input_info = symbol_set;
std::random_shuffle(input_info.begin(),input_info.end());
std::mt19937 rand_gen {1};
std::shuffle(input_info.begin(), input_info.end(), rand_gen);
int count = 0;
if((int)input_info.length() > true_capacity)
{
......@@ -390,15 +391,8 @@ TEST(Objdetect_QRCode_Encode_Decode_Structured_Append, DISABLED_regression)
std::string symbol_set = config["symbols_set"];
std::string input_info = symbol_set;
#if defined CV_CXX11
// std::random_shuffle is deprecated since C++11 and removed in C++17.
// Use manually constructed RNG with a fixed seed and std::shuffle instead.
std::mt19937 rand_gen {1};
std::shuffle(input_info.begin(), input_info.end(), rand_gen);
#else
SeededRandFunctor<1> rand_gen;
std::random_shuffle(input_info.begin(), input_info.end(), rand_gen);
#endif
for (int j = min_stuctures_num; j < max_stuctures_num; j++)
{
QRCodeEncoder::Params params;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册