Skip to content

Commit

Permalink
Fix static assertion failures produced by MSVC (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohirose authored Oct 29, 2023
1 parent 7e583fe commit d76ce0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmarks/swar/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ std::default_random_engine engine;

char random_ascii()
{
static std::uniform_int_distribution<char> dist(0x00, 0x7F);
return dist(engine);
static std::uniform_int_distribution<std::uint_least32_t> dist(0x00, 0x7F);
return static_cast<char>(dist(engine));
}

char32_t random_unicode()
{
static std::uniform_int_distribution<char32_t> dist(0x80, 0x10'FFFF);
return dist(engine);
static std::uniform_int_distribution<std::uint_least32_t> dist(0x80, 0x10'FFFF);
return static_cast<char32_t>(dist(engine));
}

float random01()
Expand Down

0 comments on commit d76ce0c

Please sign in to comment.