In D24985 @apol suggested using KRandom while @anthonyfieroni noted that std::random_shuffle is deprecated and removed in C++17 (which will be available with Qt6). However KRandom::random cannot be used with std::shuffle because it doesn't fulfill the requirements of UniformRandomBitGenerator. Surely there are more places which would benefit from better compatibility to the standard library.
Description
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Open | None | T11551 use C++ modern features | ||
Open | None | T11982 Deprecate KRandom in favor of QRandomGenerator |
Comment Actions
Or maybe some things could be dropped if there is an equivalent feature in the standard.
Comment Actions
KRandom::random should be removed and QRandomGenerator should be used instead. It has a more expressive API and will actually work properly on platforms without a /dev/urandom.
KRandom::random() -> QRandomGenerator::global()->generate() ```
Random string otoh could be kept if needed but should use QRandomGenerator internally