QRandom: remove dead pre-C++11 code

All compilers support C++11 unrestricted unions in Qt 6.

Gets rid of another instance of to-be-deprecated-in-C++-23
std::aligned_storage.

Pick-to: 6.3
Task-number: QTBUG-99122
Change-Id: I5e6dc025893c79d0c516fc2d3801ec071615b9cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2022-01-03 18:13:28 +01:00
parent bf81cd8d92
commit b8431bef37
1 changed files with 0 additions and 6 deletions

View File

@ -229,15 +229,9 @@ private:
union Storage {
uint dummy;
#ifdef Q_COMPILER_UNRESTRICTED_UNIONS
RandomEngine twister;
RandomEngine &engine() { return twister; }
const RandomEngine &engine() const { return twister; }
#else
std::aligned_storage<sizeof(RandomEngine), alignof(RandomEngine)>::type buffer;
RandomEngine &engine() { return reinterpret_cast<RandomEngine &>(buffer); }
const RandomEngine &engine() const { return reinterpret_cast<const RandomEngine &>(buffer); }
#endif
static_assert(std::is_trivially_destructible<RandomEngine>::value,
"std::mersenne_twister not trivially destructible as expected");