[#mp_units-is_value_preserving]
= xref:mp_units.adoc[mp&lowbar;units]::is&lowbar;value&lowbar;preserving
:relfileprefix: ../
:mrdocs:

Specifies if a specific conversion between two types preserves the value

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;framework&sol;customization&lowbar;points&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename From,
    typename To&gt;
constexpr bool is&lowbar;value&lowbar;preserving = treat&lowbar;as&lowbar;floating&lowbar;point&lt;To&gt; &verbar;&verbar; !treat&lowbar;as&lowbar;floating&lowbar;point&lt;From&gt;;
----

== Description

This type trait should be specialized for a custom representation types to specify weather the conversion from the source type to the destination type preserves the value or not&period; Value&hyphen;truncating conversions should be forced by the user with explicit casts&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *From*
| a source representation type
| *To*
| a destination representation type
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
