[#mp_units-quantity-01-2constructor-06a] = xref:mp_units.adoc[mp_units]::xref:mp_units/quantity-01.adoc[quantity]::quantity :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<mp‐units/framework/quantity.h>` Default constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:mp_units/quantity-01/2constructor-062.adoc[quantity]() = default; ---- [.small]#xref:mp_units/quantity-01/2constructor-062.adoc[_» more..._]# Copy constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:mp_units/quantity-01/2constructor-000.adoc[quantity](xref:mp_units/quantity-01.adoc[quantity] const& other) = default; ---- [.small]#xref:mp_units/quantity-01/2constructor-000.adoc[_» more..._]# Copy constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R2, typename Rep2> requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>> constexpr explicit(!implicitly_convertible(get_quantity_spec(R2), quantity_spec) || !std::convertible_to<Rep2, rep>) xref:mp_units/quantity-01/2constructor-00d.adoc[quantity](xref:mp_units/quantity-01.adoc[quantity<R2, Rep2>] const& q); ---- [.small]#xref:mp_units/quantity-01/2constructor-00d.adoc[_» more..._]# Move constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:mp_units/quantity-01/2constructor-01.adoc[quantity](xref:mp_units/quantity-01.adoc[quantity]&& other) = default; ---- [.small]#xref:mp_units/quantity-01/2constructor-01.adoc[_» more..._]# Construct from `Q` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:mp_units/QuantityLike.adoc[QuantityLike] Q> requires detail::QuantityConstructibleFrom<quantity, detail::quantity_like_type<Q>> constexpr explicit(quantity_like_traits<Q>::explicit_import || !std::convertible_to<detail::quantity_like_type<Q>, quantity<R, Rep>>) xref:mp_units/quantity-01/2constructor-066.adoc[quantity](Q const& q); ---- [.small]#xref:mp_units/quantity-01/2constructor-066.adoc[_» more..._]# Construct from `FwdValue` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename FwdValue> requires detail::DimensionlessOne<reference> && detail::ValuePreservingConstruction<rep, FwdValue> constexpr explicit(!std::convertible_to<FwdValue, rep>) xref:mp_units/quantity-01/2constructor-09.adoc[quantity](FwdValue&& val); ---- [.small]#xref:mp_units/quantity-01/2constructor-09.adoc[_» more..._]# Constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename FwdValue, xref:mp_units/Reference.adoc[Reference] R2> requires (equivalent(unit, get_unit(R2{}))) && detail::ValuePreservingConstruction<rep, FwdValue> constexpr xref:mp_units/quantity-01/2constructor-05.adoc[quantity]( FwdValue&& val, R2); ---- [.small]#xref:mp_units/quantity-01/2constructor-05.adoc[_» more..._]# Constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename FwdValue, xref:mp_units/Reference.adoc[Reference] R2> requires (!equivalent(unit, get_unit(R2{}))) && detail::QuantityConstructibleFrom<quantity, quantity<R2{}, std::remove_cvref_t<FwdValue>>> constexpr xref:mp_units/quantity-01/2constructor-04.adoc[quantity]( FwdValue&& val, R2); ---- [.small]#xref:mp_units/quantity-01/2constructor-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#