.. namespace:: units Concepts ======== .. note:: All names defined in this chapter reside in the :any:`units` namespace unless specified otherwise. .. concept:: template PrefixFamily A concept matching a prefix family. Satisfied by all types derived from :class:`prefix_family`. .. concept:: template Prefix A concept matching a symbol prefix. Satisfied by all instantiations of :class:`prefix`. .. concept:: template UnitRatio Satisfied by all ratio values for which :expr:`R.num > 0` and :expr:`R.den > 0`. .. concept:: template BaseDimension A concept matching all base dimensions in the library. Satisfied by all dimension types derived from the instantiation of :class:`base_dimension`. .. concept:: template Exponent A concept matching dimension's exponents. Satisfied by all instantiations of :class:`exponent`. .. concept:: template DerivedDimension A concept matching all derived dimensions in the library. Satisfied by all dimension types derived from the instantiation of ``detail::derived_dimension_base``. .. concept:: template Dimension A concept matching all dimensions in the library. Satisfied by all dimension types for which either :expr:`BaseDimension` or :expr:`DerivedDimension` is ``true``. .. concept:: template Unit A concept matching all unit types in the library. Satisfied by all unit types derived from the instantiation of :class:`scaled_unit`. .. concept:: template UnitOf A concept matching only units of a specified dimension. Satisfied by all unit types that satisfy :expr:`Unit`, :expr:`Dimension`, and for which :expr:`U::reference` and ``dimension_unit::reference`` denote the same unit type. :tparam U: Type to verify against concept constraints. :tparam D: Dimension type to use for verification. .. concept:: template Quantity A concept matching all quantities in the library. Satisfied by all instantiations of :class:`quantity`. .. concept:: template WrappedQuantity A concept matching types that wrap quantity objects. Satisfied by all wrapper types that satisfy :expr:`Quantity` recursively (i.e. ``std::optional>``). .. concept:: template QuantityValue A concept matching types that can be used as a `Quantity` representation type. Satisfied by types that match :expr:`(!Quantity) && (!WrappedQuantity) && std::regular` and satisfy one of the following: - if :expr:`common_type_with` is ``true``, then :expr:`std::common_type_t` must at least provide binary multiplication and division operators, - otherwise, :expr:`T::value_type` must be valid, :expr:`common_type_with` be ``true``, and :expr:`std::common_type_t` must at least provide binary multiplication and division operators with itself and ``T``. .. concept:: template QuantityPoint A concept matching all quantity points in the library. Satisfied by all instantiations of :class:`quantity_point`. .. concept:: template typename DimTemplate> DimensionOfT A concept matching all dimensions being the instantiations derived from the provided dimension class template. .. concept:: template typename DimTemplate> QuantityOfT A concept matching all quantities with a dimension being the instantiation derived from the provided dimension class template. .. concept:: template QuantityOf A concept matching all quantities with a dimension being the instantiation derived from the provided dimension type.