Class DimensionException

Exception thrown when operating on two units that are not interconvertible.

class DimensionException
  : object.Exception ;

Fields

NameTypeDescription
otherDim DimensionsHolds the dimensions of the eventual other operand
thisDim DimensionsHolds 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);