Skip to content

Commit

Permalink
[qty.dim] Update for removal of _DerivedDimensionExpr_
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Oct 26, 2024
1 parent 49cb247 commit 0248136
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions docs/api_reference/src/quantities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
template<symbol_text Symbol>
struct base_dimension;

template<@\seebelownc@>
template<typename... Expr>
struct derived_dimension;

struct dimension_one;
Expand Down Expand Up @@ -845,26 +845,6 @@
template<typename T>
concept @\defexposconceptnc{BaseDimension}@ = @\libconcept{Dimension}@<T> && std::@\stdconcept{derived_from}@<T, base_dimension>;

consteval bool @\exposidnc{is-dimension-one}@(std::meta::info type_alias) {
return dealias(type_alias) == ^dimension_one;
}

template<typename T>
concept @\defexposconceptnc{IsPowerOfDim}@ =
(@\exposidnc{is-specialization-of}@(^T, ^power) &&
(@\exposconceptnc{BaseDimension}@<typename T::factor> || @\exposidnc{is-dimension-one}@(^typename T::factor)));

template<typename T>
constexpr bool @\exposidnc{is-per-of-dims}@ = false;

template<typename... Ts>
constexpr bool @\exposidnc{is-per-of-dims}@<per<Ts...>> =
(... && (@\exposconceptnc{BaseDimension}@<Ts> || @\exposidnc{is-dimension-one}@(^Ts) || @\exposconceptnc{IsPowerOfDim}@<Ts>));

template<typename T>
concept @\defexposconceptnc{DerivedDimensionExpr}@ =
@\exposconceptnc{BaseDimension}@<T> || @\exposidnc{is-dimension-one}@(^T) || @\exposconceptnc{IsPowerOfDim}@<T> || @\exposidnc{is-per-of-dims}@<T>;

template<typename T, auto D>
concept @\deflibconcept{DimensionOf}@ = @\libconcept{Dimension}@<T> && @\libconcept{Dimension}@<decltype(D)> && T{} == D;
\end{itemdecl}
Expand Down Expand Up @@ -911,10 +891,10 @@
\begin{codeblock}
namespace mp_units {
template<@\exposconceptnc{DerivedDimensionExpr}@... Expr>
template<typename... Expr>
struct @\exposidnc{derived-dimension-impl}@ : @\exposidnc{expr-fractions}@<struct dimension_one, Expr...> {};
template<@\exposconceptnc{DerivedDimensionExpr}@... Expr>
template<typename... Expr>
struct @\libglobal{derived_dimension}@ final : @\exposidnc{dimension-interface}@, @\exposidnc{derived-dimension-impl}@<Expr...> {};
}
Expand Down

0 comments on commit 0248136

Please sign in to comment.