3 ms·
Can you provide examples?
by antoineMoPa 3y ago
Can you provide examples?
- pif 3y ago- 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.
- n_plus_1_acc 3y agohttps://crates.io/crates/uom https://crates.io/crates/uom trivially convertable to cpp
- n_plus_1_acc 3y agohttps://www.boost.org/doc/libs/1_82_0/doc/html/boost_units/Units.html https://www.boost.org/doc/libs/1_82_0/doc/html/boost_units/U...
- leakim 3y agoIn Scala https://github.com/typelevel/squants https://github.com/typelevel/squants