mp_units::derived_dimension¶
A dimension of a derived quantity
Synopsis¶
Declared in <mp-units/framework/dimension.h>
template</* implementation-defined */... Expr>
struct derived_dimension final
: /* implementation-defined */
, /* implementation-defined */
Description¶
Derived dimension is an expression of the dependence of a quantity on the base quantities of a system of quantities as a product of powers of factors corresponding to the base quantities, omitting any numerical factors.
Instead of using a raw list of exponents this library decided to use symbolic expression syntax to make types more digestable for the user. The positive exponents are ordered first and all negative exponents are put as a list into the per<...> class template. If a power of exponent is different than 1 the dimension type is enclosed in power<Dim, Num, Den> class template. Otherwise, it is just put directly in the list without any wrapper. There is also one special case. In case all of the exponents are negative than the dimension_one being a dimension of a dimensionless quantity is put in the front to increase the readability.
For example:
using frequency = decltype(inverse(dim_time));
using speed = decltype(dim_length / dim_time);
using acceleration = decltype(dim_speed / dim_time);
using force = decltype(dim_mass * dim_acceleration);
using energy = decltype(dim_force * dim_length);
using moment_of_force = decltype(dim_length * dim_force);
using torque = decltype(dim_moment_of_force);
frequencywill be derived from typederived_dimension<dimension_one, per<dim_time>>speedwill be derived from typederived_dimension<dim_length, per<dim_time>>accelerationwill be derived from typederived_dimension<dim_length, per<power<dim_time, 2>>>forcewill be derived from typederived_dimension<dim_length, dim_mass, per<power<dim_time, 2>>>energywill be derived from typederived_dimension<power<dim_length, 2>, dim_mass, per<power<dim_time, 2>>>
NOTE
NOTE
Base Classes¶
| Name | Description |
|---|---|
/* implementation-defined */ | |
/* implementation-defined */ |
Template Parameters¶
| Name | Description |
|---|---|
| Ds | a parameter pack consisting tokens allowed in the dimension specification (base dimensions, dimension_one, power<Dim, Num, Den>, per<...>) |