forked from mpusz/mp-units
docs: quantity_of concepts family documentation added
This commit is contained in:
@@ -78,3 +78,18 @@ Concepts
|
|||||||
|
|
||||||
A concept matching all quantity points in the library. Satisfied by all instantiations of
|
A concept matching all quantity points in the library. Satisfied by all instantiations of
|
||||||
:class:`quantity_point`.
|
:class:`quantity_point`.
|
||||||
|
|
||||||
|
.. concept:: template<typename Dim, template<typename...> typename DimTemplate> concept DimensionOfT
|
||||||
|
|
||||||
|
A concept matching all dimensions being the instantiations derived from the provided dimension
|
||||||
|
class template.
|
||||||
|
|
||||||
|
.. concept:: template<typename Q, template<typename...> typename DimTemplate> concept QuantityOfT
|
||||||
|
|
||||||
|
A concept matching all quantities with a dimension being the instantiation derived from
|
||||||
|
the provided dimension class template.
|
||||||
|
|
||||||
|
.. concept:: template<typename T, typename Dim> concept QuantityOf
|
||||||
|
|
||||||
|
A concept matching all quantities with a dimension being the instantiation derived from
|
||||||
|
the provided dimension type.
|
||||||
|
@@ -45,6 +45,12 @@ concept EquivalentUnknownDimensionOfT = Dimension<Dim> && is_derived_from_specia
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A concept matching all dimensions matching provided dimension class template
|
||||||
|
*
|
||||||
|
* Satisfied by all dimensions being the instantiations derived from the provided dimension
|
||||||
|
* class template.
|
||||||
|
*/
|
||||||
template<typename Dim, template<typename...> typename DimTemplate>
|
template<typename Dim, template<typename...> typename DimTemplate>
|
||||||
concept DimensionOfT = Dimension<Dim> && (is_derived_from_specialization_of<Dim, DimTemplate>
|
concept DimensionOfT = Dimension<Dim> && (is_derived_from_specialization_of<Dim, DimTemplate>
|
||||||
#if DOWNCAST_MODE == 0
|
#if DOWNCAST_MODE == 0
|
||||||
@@ -52,13 +58,22 @@ concept DimensionOfT = Dimension<Dim> && (is_derived_from_specialization_of<Dim,
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
// QuantityOfT
|
/**
|
||||||
|
* @brief A concept matching all quantities with provided dimension class template
|
||||||
|
*
|
||||||
|
* Satisfied by all quantities with a dimension being the instantiation derived from
|
||||||
|
* the provided dimension class template.
|
||||||
|
*/
|
||||||
template<typename Q, template<typename...> typename DimTemplate>
|
template<typename Q, template<typename...> typename DimTemplate>
|
||||||
concept QuantityOfT = Quantity<Q> && DimensionOfT<typename Q::dimension, DimTemplate>;
|
concept QuantityOfT = Quantity<Q> && DimensionOfT<typename Q::dimension, DimTemplate>;
|
||||||
|
|
||||||
// QuantityOf
|
/**
|
||||||
|
* @brief A concept matching all quantities with provided dimension
|
||||||
|
*
|
||||||
|
* Satisfied by all quantities with a dimension being the instantiation derived from
|
||||||
|
* the provided dimension type.
|
||||||
|
*/
|
||||||
template<typename T, typename Dim>
|
template<typename T, typename Dim>
|
||||||
concept QuantityOf = Quantity<T> && Dimension<Dim> && equivalent<typename T::dimension, Dim>;
|
concept QuantityOf = Quantity<T> && Dimension<Dim> && equivalent<typename T::dimension, Dim>;
|
||||||
|
|
||||||
|
|
||||||
} // namespace units
|
} // namespace units
|
||||||
|
Reference in New Issue
Block a user