bool64 类型在哪里?

Where's the bool64 type?

我目前正在移植一个在某些情况下使用 longbool 的小应用程序,如果我能找到的话,我会使用 bool64 类型。将类型更改为 in64 然后 set/check for 0 以查找是否 true/false 不是一个大问题,但如果有某种方法可以启用 bool64 我会使用它。

有人知道吗?

没有 64 位宽的布尔类型。布尔类型列在 documentation:

The 4 predefined Boolean types are Boolean, ByteBool, WordBool, and LongBool. Boolean is the preferred type. The others exist to provide compatibility with other languages and operating system libraries.

A Boolean variable occupies one byte of memory, a ByteBool variable also occupies one byte, a WordBool variable occupies 2 bytes (one word), and a LongBool variable occupies 4 bytes (2 words).

因此,如果您需要充当布尔值的 64 位类型,则必须使用 64 位整数。您可能可以通过使用隐式强制转换运算符来回 Boolean 的增强记录来使语法更易于接受。

我无法想象您为什么需要 64 位布尔值。我从来没有遇到过使用这种类型的库。不知你是不是想错了。

FreePascal 有一个 64 位 C 布尔类型,并将其称为“qwordbool”