3 ms·
It's possible to go even further than just protecting against the wrong unit in the wrong place. You can generalise units: https://docs.rs/dimensioned/latest/di
by hgomersall 4y ago
It's possible to go even further than just protecting against the wrong unit in the wrong place. You can generalise units: https://docs.rs/dimensioned/latest/dimensioned/ https://docs.rs/dimensioned/latest/dimensioned/
(Edit, that's not possible in c++)
- jdrek1 4y ago> (Edit, that's not possible in c++) Mind expanding on that? Because what that readme there shows is absolutely possible in C++, I have used a similar system for dealing with natural units.
- hgomersall 4y agoI'm happy to admit I'm wrong on that. My understanding is the bit that makes (kg.m)/s^2 type equivalent to a N, equivalent to J/m is not implementable in the same generic way.
- pencilguin 4y agoAll unit systems decompose each unit to primitives, that can then be aliased for notational convenience. So, a result of J/m decomposes the same as a N.