Some of us don’t want to wait until the heat death of the universe for the code to compile (not a snipe at boost as a whole - boost units is quite bad iirc). There’s also performance problems if the compiler isn’t able to see through all the templates although that’s true for many things in this space. Finally iirc it doesn’t let you define your own custom units which is a common challenge with dimensional analysis as a library.
If rust ever gets more complete const generics, then things like tiny-uom might work.
- you define a template class accepting 1 constant integer for each dimension you want to consider (length and/or time and/or mass and/or temperature);
- you define addition and subtraction between objects of one type returning an object of the same type;
- you define multiplication and division as returning an object of a type with the dimensions summed or subtracted;
- and you get dimensional correctness via type safety.
If rust ever gets more complete const generics, then things like tiny-uom might work.