14[[noreturn]]
void Abort()
noexcept;
26class SelectValue final {
28 constexpr SelectValue() =
default;
30 constexpr SelectValue& ForLibCpp64(T value)
noexcept {
return Set(Bits::k64, StdLibs::kCpp, value); }
32 constexpr SelectValue& ForLibStdCpp64(T value)
noexcept {
return Set(Bits::k64, StdLibs::kStdCpp, value); }
34 constexpr SelectValue& ForLibCpp32(T value)
noexcept {
return Set(Bits::k32, StdLibs::kCpp, value); }
36 constexpr SelectValue& ForLibStdCpp32(T value)
noexcept {
return Set(Bits::k32, StdLibs::kStdCpp, value); }
38 constexpr SelectValue& For64Bit(T value)
noexcept {
return Set(Bits::k64, StdLibs::kAny, value); }
40 constexpr SelectValue& For32Bit(T value)
noexcept {
return Set(Bits::k32, StdLibs::kAny, value); }
42 constexpr operator T()
const noexcept {
43 if (has_stdlib_value_) {
45 }
else if (has_bits_value_) {
64 constexpr SelectValue& Set(Bits bits, StdLibs lib, T value)
noexcept {
65 constexpr auto kBits = (
sizeof(
void*) == 8 ? Bits::k64 : Bits::k32);
67#if defined(_LIBCPP_VERSION)
76 has_stdlib_value_ =
true;
77 stdlib_value_ = value;
78 }
else if (lib == StdLibs::kAny) {
79 has_bits_value_ =
true;
89 bool has_stdlib_value_ =
false;
90 bool has_bits_value_ =
false;
95using SelectSize = SelectValue<std::size_t>;