Checks whether a quantity of quantity spec From can be cast to quantity spec To
Declared in <mp-units/framework/quantity_spec_conversion.h>
template<
QuantitySpec From,
QuantitySpec To>
[[nodiscard]]
consteval
bool
castable(
From from,
To to);
castable is a weaker requirement than explicitly_convertible and is used to validate quantities belonging to the same kind but with otherwise unrelated equations.
| Name | Description |
|---|---|
| From | source quantity specification type |
| To | target quantity specification type |
| Name | Description |
|---|---|
| from | source quantity specification value |
| to | target quantity specification value |