arena allocator + incremental garbage collector
  • C++ 98.4%
  • CMake 1.6%
Find a file
2024-04-22 15:30:17 -04:00
.github/workflows xo-unit: github: allow unfree helvetica-neue font 2024-04-03 15:14:26 -04:00
cmake xo-unit: build: ++ GUESSED_CMAKE_CMD 2024-04-19 13:31:56 -04:00
docs xo-unit: cosmetic doc tweaks 2024-04-17 20:55:19 -04:00
example xo-unit: refactor: moving og quantity.hpp to mpl/ subdir 2024-04-22 15:13:40 -04:00
include/xo/unit xo-unit: refactor: move .hpp files to mpl/ 2024-04-22 15:30:17 -04:00
pkgs xo-unit: nix: build docs 2024-04-03 15:01:42 -04:00
utest xo-unit: refactor: more files to mpl/ subdir 2024-04-22 15:28:36 -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: + debug build defaults 2024-04-19 13:31:44 -04:00
flake.nix xo-unit: nix: build docs 2024-04-03 15:01:42 -04:00
LICENSE xo-unit: + LICENSE 2024-04-02 17:30:52 -04:00
README.md xo-cmake: README: minor tweak 2024-04-17 20:55:01 -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)

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
$ cd .build-ccov
$ cmake -DCMAKE_MODULE_PATH=${PREFIX}/share/cmake  -DCMAKE_PREFIX_PATH=${PREFIX} -DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug ..

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