Skip to content

Draft: Add bool type

This MR adds boolean type to the memory manager.

Some facts of the boolean type:

  1. Fortran default logical has a size of 4 bytes. The C bool is one byte.
  2. std::vector<bool> is an experimental feature. All values are stored in one bit, not one byte. https://en.cppreference.com/w/cpp/container/vector_bool.html
  3. bool is an extension of _Bool in the stdbool.h header. https://en.cppreference.com/w/c/header/stdbool.html
  4. stdbool.h will be deprecated in C++23. bool, true, and false will be predefined types and constants. https://en.cppreference.com/w/c/types.html
  5. Before C++23, true and false are integers. From C++23, they are bool constants. https://en.cppreference.com/w/c/language/bool_constant.html

We use int8_t (signed char) to store the boolean values in the backend.

Edited by Yen-Chen Chen

Merge request reports

Loading