Archived issue #0032909

Coding Rules - replace (removed from C++17) `std::random_shuffle` with `std::shuffle` for random permutation algorithm

Open CASCADEOCCT:Codingclosed7 public notes

Search issues

Description

Since C++17 the accessible version of permutation function left the function:
    
    template< class RandomIt, class URBG >
    void shuffle( RandomIt first, RandomIt last, URBG&& g );
    
    See details and example of use: https://en.cppreference.com/w/cpp/algorithm/random_shuffle

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Dmitry DZAMA
Date: Wed Mar 30 12:30:01 2022 +0300

    0032909: Replace (removed from C++17) `std::random_shuffle` with `std::shuffle` for random permutation algorithm
    
    Since C++17 the accessible version of permutation function left the function:
    
    template< class RandomIt, class URBG >
    void shuffle( RandomIt first, RandomIt last, URBG&& g );
    
    See details and example of use: https://en.cppreference.com/w/cpp/algorithm/random_shuffle
02Commenter 1
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
03Commenter 1
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
04Commenter 1
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
05Commenter 2
Please raise the patch if it compiles on older supported compilers.
06Commenter 6
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18452.87000000039 / 18490.94000000032 [-0.21%]
Products
Total CPU difference: 11761.310000000152 / 11719.920000000124 [+0.35%]
Windows-64-VC14:
OCCT
Total CPU difference: 20539.828125 / 20552.71875 [-0.06%]
Products
Total CPU difference: 13248.21875 / 13242.609375 [+0.04%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
07Commenter 1
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records