[#mp_units-castable] = xref:mp_units.adoc[mp_units]::castable :relfileprefix: ../ :mrdocs: Checks whether a quantity of quantity spec `From` can be cast to quantity spec `To` == Synopsis Declared in `<mp‐units/framework/quantity_spec_conversion.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/QuantitySpec.adoc[QuantitySpec] From, xref:mp_units/QuantitySpec.adoc[QuantitySpec] To> [[nodiscard]] consteval bool castable( From from, To to); ---- == Description `castable` is a weaker requirement than xref:mp_units/explicitly_convertible.adoc[`explicitly_convertible`] and is used to validate quantities belonging to the same kind but with otherwise unrelated equations. == Return Value `true` if `from` can be cast to `to` [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Template Parameters [cols="1,4"] |=== | Name| Description | *From* | source quantity specification type | *To* | target quantity specification type |=== == Parameters [cols="1,4"] |=== | Name| Description | *from* | source quantity specification value | *to* | target quantity specification value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#