bit_logic > Philosophy

Philosophy

The types in this library are not mathematical in nature. Comparison operators are provided for ordering, but the intention of the library is to model containers of "bits". Extracting and converting these bits into other types are provided, but the containers themselves maintain no added type information about the bits contained within them.

Design Guidelines

  • Attempt to make the semantic description of bit operations as close as possible to HDL.
  • Attempt to eliminate undefined behavior, at the cost of added checking.
  • Avoid doing anything that is not specified by the C++ standard.
  • Never do the wrong thing silently.
  • Detect as many errors as possible at compile time.
  • Detect the rest of errors at runtime and throw exceptions.
  • Within the above guidelines make it as high performance as possible.