#pragma once #include #include #include namespace NYql { class TRandGuid { public: TRandGuid(); TRandGuid(TRandGuid&&) = default; TRandGuid& operator=(TRandGuid&&) = default; void ResetSeed(); TString GenGuid(); ui64 GenNumber(); private: TMersenne& GetRnd() { return reinterpret_cast&>(Rnd_); } private: std::aligned_storage) ,alignof(TMersenne)>::type Rnd_; static TAtomic Counter; }; }