Skip to content

Commit

Permalink
Merge pull request #1594 from ANTsX/shuffle
Browse files Browse the repository at this point in the history
COMP: Github windows runners were attempting to use deprecated
  • Loading branch information
cookpa authored Aug 31, 2023
2 parents d63da7a + cdb71f1 commit 3b3c0e2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Examples/sccan.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,15 @@ PermuteMatrix(vnl_matrix<TComp> q, bool doperm = true)
}
// std::random_shuffle is deprecated since C++14,
// see: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm
#if __cplusplus >= 201402L
std::shuffle(permvec.begin(), permvec.end(), std::random_device());
#else
std::random_shuffle(permvec.begin(), permvec.end(), sccanRandom);
#endif
// 2023-08-30: MSVC 2019 on Github Actions runners having problems detecting C++ version,
// so use new std::shuffle
// #if __cplusplus >= 201402L
// std::shuffle(permvec.begin(), permvec.end(), std::random_device());
// #else
// std::random_shuffle(permvec.begin(), permvec.end(), sccanRandom);
// #endif
std::shuffle(permvec.begin(), permvec.end(), std::random_device());

// for (unsigned long i=0; i < q.rows(); i++)
// // std::cout << " permv " << i << " is " << permvec[i] << std::endl;
// for (unsigned long i=0; i < q.rows(); i++)
Expand Down

0 comments on commit 3b3c0e2

Please sign in to comment.