package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v2.8.tar.gz
md5=03b80e963186e91ddac62ef645bf7fb2
sha512=c8f434808be540c16926bf03d89f394d33fc2d092f963a7b6d412481229e0a96290f1ad7c7d522415115d35426b7aa0b3fda4b991ddc321dad279d402c9a0c0b

doc/containers.data/CCBitField/index.html

Module CCBitFieldSource

Bit Field

This module defines efficient bitfields up to 30 or 62 bits (depending on the architecture) in a relatively type-safe way.

  module B = CCBitField.Make(struct end);;

  let x = B.mk_field ()
  let y = B.mk_field ()
  let z = B.mk_field ()

  let f = B.empty |> B.set x true |> B.set y true;;

  assert (not (B.get z f)) ;;

  assert (f |> B.set z true |> B.get z);;
Sourceexception TooManyFields

Raised when too many fields are packed into one bitfield.

Sourceexception Frozen

Raised when a frozen bitfield is modified.

Sourceval max_width : int

System-dependent maximum width for a bitfield, typically 30 or 62.

Sourcemodule type S = sig ... end
Sourcemodule Make (X : sig ... end) : S

Create a new bitfield type

OCaml

Innovation. Community. Security.

On This Page
  1. Bit Field