cmbi/hssp

Issue with compiling in C++14 and std::random_shuffle

Closed this issue · 1 comments

Compiling with C++14 throws the following error:

src/hssp-nt.cpp:1246:19: error: ‘void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<shared_ptr<HSSP::MHit>*, vector<shared_ptr<HSSP::MHit> > >]’ is deprecated: use 'std::shuffle' instead [-Werror=deprecated-declarations]
 1246 |     random_shuffle(m_entries.begin(), m_entries.end());
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13.2.1/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~

This is due to std::random_shuffle being deprecated in C++14. I have a commit that I think fixes this issue, by switching to std::shuffle and adding an rng state to the MProfile object.

Thank you for notifying us. We will look into what will be the best way to do this.