0

I've got some older code which uses std::uniform_int and std::variate_generator. On one machine I use GCC 4.8.5 and it works pretty fine. On my newer workstation I have GCC 7.2.1 installed and it is not possible to compile the code.

The error message is, that uniform_int and variate_generator are not members of std. I found some information that in newer C++ standards they are not supported anymore and for uniform_int uniform_int_distribution should be used.

Is there any possibility to extend the code that it will work on both machine. For example to use some "adapter-code" to rebuild the interface of uniform_int_distribution to uniform_int?

Matt
  • 2,554
  • 2
  • 24
  • 45
Schrigga
  • 11
  • 1
  • as far as I recall, that's based on older boost.random. So, you may try finding the last boost version supporting it and use it as a drop-in replacement instead ... – Massimiliano Janes Nov 16 '17 at 14:30
  • indeed, it looks like [boost1.47](http://www.boost.org/users/history/version_1_47_0.html) synchronized with the standard version; anyway, if I read the release notes correctly, there are ready-made wrappers for your use case ... – Massimiliano Janes Nov 16 '17 at 15:17
  • I had a similar issue when compiling with g++ 7.2.0. I was missing an include to – Finn Nov 16 '17 at 15:57

0 Answers0