26 constexpr auto subset(
const std::bitset<bit_size>& bits) -> std::bitset<max - min>
28 constexpr auto max_size = 64;
29 static_assert(max > min);
30 static_assert(max_size >= (max - min));
31 constexpr auto ignore_high = bit_size - max;
33 auto new_bits = (bits << ignore_high) >> (ignore_high + min);
34 return std::bitset<max - min>{ new_bits.to_ullong() };
38 constexpr auto merge_bits(
const std::bitset<high_size>& high_bits,
const std::bitset<low_size>& low_bits)
39 -> std::bitset<high_size + low_size>
41 using NewBit = std::bitset<high_size + low_size>;
42 constexpr auto max_size = 64;
43 static_assert(max_size >= high_size + low_size);
45 auto high_bits_part = NewBit(high_bits.to_ullong());
46 auto low_bits_part = NewBit(low_bits.to_ullong());
47 auto new_bits = (high_bits_part << low_size) | low_bits_part;
48 return std::bitset<high_size + low_size>(new_bits.to_ullong());
86 auto filepath = std::filesystem::path{ native_name };
87 auto extension = filepath.extension().string();
88 auto file_basename = filepath.replace_extension().string();
89 return std::format(
"{}_{}{}", file_basename, idx, extension);