fix init ordering of members

pull/3147/head
Kim Kulling 2020-04-15 20:41:38 +02:00 committed by GitHub
parent a0218c690b
commit d46ec3f9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team Copyright (c) 2006-2020, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -54,10 +52,17 @@ template<typename T>
class RandomUniformRealGenerator { class RandomUniformRealGenerator {
public: public:
RandomUniformRealGenerator() : RandomUniformRealGenerator() :
rd_(), re_(rd_()), dist_() { dist_(),
rd_(),
re_(rd_()), {
// empty
} }
RandomUniformRealGenerator(T min, T max) : RandomUniformRealGenerator(T min, T max) :
rd_(), re_(rd_()), dist_(min, max) { dist_(min, max),
rd_(),
re_(rd_()), {
// empty
} }
inline T next() { inline T next() {
@ -65,10 +70,9 @@ public:
} }
private: private:
std::uniform_real_distribution<T> dist_; std::uniform_real_distribution<T> dist_;
std::default_random_engine re_;
std::random_device rd_; std::random_device rd_;
std::default_random_engine re_;
}; };
using RandomUniformFloatGenerator = RandomUniformRealGenerator<float>; using RandomUniformFloatGenerator = RandomUniformRealGenerator<float>;