mp_units::quantity::quantity¶
Constructors
Synopses¶
Declared in <mp-units/framework/quantity.h>
Default constructor
[[nodiscard]] quantity() = default;
Construct from quantity
template<auto R2, typename Rep2>
requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>> && (equivalent(unit, get_unit(R2)))
[[nodiscard]] constexpr explicit(!std::convertible_to<Rep2, rep> ||
!mp_units::implicitly_convertible(get_quantity_spec(R2), quantity_spec) ||
!mp_units::implicitly_scalable<get_unit(R2), Rep2, unit, rep>)
quantity(quantity<R2, Rep2> const& q);
Construct from quantity
template<auto R2, typename Rep2>
requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>> && (!equivalent(unit, get_unit(R2)))
[[nodiscard]] constexpr explicit(!std::convertible_to<Rep2, rep> ||
!mp_units::implicitly_convertible(get_quantity_spec(R2), quantity_spec) ||
!mp_units::implicitly_scalable<get_unit(R2), Rep2, unit, rep>)
quantity(quantity<R2, Rep2> const& q);
Construct from rep
[[nodiscard]] constexpr explicit(!mp_units::implicitly_convertible(quantity_spec, dimensionless)) quantity(rep val)
requires detail::ExplicitFromNumber<reference>;
Construct from Value
template<typename Value>
requires detail::ExplicitFromNumber<reference> && detail::RepConstructibleFrom<rep, Value> &&
(!std::convertible_to<Value, rep>)
[[nodiscard]] constexpr explicit quantity(Value val);
Construct from Value
template<typename Value>
requires detail::ExplicitFromNumber<reference> && (!detail::RepConstructibleFrom<rep, Value>)
constexpr explicit(!std::convertible_to<Value, rep> || !mp_units::implicitly_convertible(quantity_spec, dimensionless))
quantity(Value val) = delete;
Construct from Q
template<QuantityLike Q>
requires detail::QuantityConstructibleFrom<quantity, detail::quantity_like_type<Q>>
[[nodiscard]] constexpr explicit(quantity_like_traits<Q>::explicit_import ||
!std::convertible_to<detail::quantity_like_type<Q>, quantity<R, Rep>>)
quantity(Q const& q);
Constructor
template<Reference R2>
requires(equivalent(unit, get_unit(R2{})))
[[nodiscard]] constexpr quantity(rep val, R2);
Constructor
template<typename Value, Reference R2>
requires(equivalent(unit, get_unit(R2{}))) && (!detail::RepConstructibleFrom<rep, Value>)
constexpr quantity(Value val, R2) = delete;
Constructor
template<typename FwdValue, Reference R2>
requires(!equivalent(unit, get_unit(R2{}))) &&
detail::QuantityConstructibleFrom<quantity, quantity<R2{}, std::remove_cvref_t<FwdValue>>>
[[nodiscard]] constexpr quantity(FwdValue&& val, R2);