arena allocator + incremental garbage collector
  • C++ 98.4%
  • CMake 1.6%
Find a file
2024-05-07 15:07:22 -04:00
.github/workflows xo-unit: fix deps for ubuntu build 2024-05-01 23:21:05 -04:00
cmake xo-unit: build: exported cmake config must pull xo_ratio 2024-04-28 14:54:33 -04:00
docs xo-unit: docs: document xo::qty::dimension enum 2024-05-07 13:54:28 -04:00
example xo-unit: simplify-api: represent quantity<> unit using scaled_unit<> 2024-05-07 15:07:22 -04:00
include/xo/unit xo-unit: simplify-api: represent quantity<> unit using scaled_unit<> 2024-05-07 15:07:22 -04:00
pkgs xo-unit: nix: + missing deps 2024-05-02 11:22:12 -04:00
utest xo-unit: simplify-api: represent quantity<> unit using scaled_unit<> 2024-05-07 15:07:22 -04:00
.gitignore looks like nix flakes needs not-git-ignored flake.lock 2024-04-03 13:04:46 -04:00
CMakeLists.txt xo-unit: build: need explicit xo-flatstring dep (wtf) 2024-04-28 14:54:51 -04:00
flake.nix xo-unit: nix: supply xo-flatstring dep 2024-05-02 11:22:34 -04:00
LICENSE xo-unit: + LICENSE 2024-04-02 17:30:52 -04:00
README.md xo-unit: build: streamline docs+utest setup 2024-04-25 18:15:51 -04:00

unit library

Provides compile-time dimension checking and scaling.

Similar to boost::units, but:

  1. streamlined: assumes modern (c++20) support
  2. supports fractional dimensions (rational powers)

Documentation

Getting Started

build + install dependencies

build + install

$ cd xo-unit
$ mkdir .build
$ cd .build
$ PREFIX=/usr/local  # or wherever you prefer
$ cmake -DCMAKE_MODULE_PATH=${PREFIX}/share/cmake -DCMAKE_PREFIX_PATH=${PREFIX} -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
$ make
$ make install

build documentation

$ cd xo-unit
$ cmake --build .build -- sphinx

When this completes, point local browser to xo-unit/.build/docs/sphinx/index.html.

build for unit test coverage

$ cd xo-unit
$ mkdir .build-ccov
$ cmake -DCMAKE_BUILD_TYPE=coverage -DCMAKE_PREFIX_PATH=${PREFIX} -B .build-ccov

run coverage-enabled unit tests

$ cmake --build .build-ccov -- test

generate html+text coverage report

$cmake --build .build-ccov -- ccov

LSP support

$ cd xo-unit
$ ln -s .build/compile_commands.json  # lsp will look for compile_commands.json in the root of the source tree