[lldb] uint8_t -> unsigned short in std::independent_bits_engine

According to [1], the template parameter must be cv-unqualified and one
of unsigned short, unsigned int, unsigned long, or unsigned long long.

Should fix the following MSVC error:

  error: static assertion failed due to requirement
  '_Is_any_of_v<unsigned char, unsigned short, unsigned int, unsigned
  long, unsigned long long>': invalid template argument for
  independent_bits_engine: N4659

[1] https://en.cppreference.com/w/cpp/numeric/random/independent_bits_engine
This commit is contained in:
Jonas Devlieghere 2025-04-02 09:21:48 -07:00
parent 00122bb56b
commit 6f959a46c0
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D

View File

@ -123,7 +123,8 @@ UUID UUID::Generate(uint32_t num_bytes) {
// If getRandomBytes failed, fall back to a lower entropy source.
if (ec) {
auto seed = std::chrono::steady_clock::now().time_since_epoch().count();
std::independent_bits_engine<std::default_random_engine, CHAR_BIT, uint8_t>
std::independent_bits_engine<std::default_random_engine, CHAR_BIT,
unsigned short>
engine(seed);
std::generate(bytes.begin(), bytes.end(), std::ref(engine));
}