Class DimensionException
Exception thrown when operating on two units that are not interconvertible.
class DimensionException
: object .Exception
;
Fields
Name | Type | Description |
---|---|---|
otherDim
|
Dimensions | Holds the dimensions of the eventual other operand |
thisDim
|
Dimensions | Holds the dimensions of the quantity currently operated on |
Example
import std .exception : assertThrown;
enum meter = unit!double("L");
enum second = unit!double("T");
assertThrown!DimensionException(meter + second);