|
|
|
|
|
by pif
948 days 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. |
|