A dimension of a base quantity

Synopsis

Declared in <mp‐units/framework/dimension.h>

template<symbol_text Symbol>
struct base_dimension
    : /* implementation-defined */

Base Classes

Name

Description

/* implementation-defined */

Static Data Members

Name

Description

_symbol_

Unique base dimension identifier

Description

Base quantity is a quantity in a conventionally chosen subset of a given system of quantities, where no quantity in the subset can be expressed in terms of the other quantities within that subset. They are referred to as being mutually independent since a base quantity cannot be expressed as a product of powers of the other base quantities.

Symbol template parameter is an unique identifier of the base dimension. The same identifiers can be multiplied and divided which will result with an adjustment of its factor in an exponent of a derived_dimension (in case of zero the dimension will be simplified and removed from further analysis of current expresion).

User should derive a strong type from this class template rather than use it directly in the source code. For example:

{.cpp}
 inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length;
 inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time;
 inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass;
Note
A common convention in this library is to assign the same name for a type and an object of this type. Besides defining them user never works with the dimension types in the source code. All operations are done on the objects. Contrarily, the dimension types are the only one visible in the compilation errors. Having them of the same names improves user experience and somehow blurs those separate domains.

Template Parameters

Name

Description

Symbol

an unique identifier of the base dimension used to provide dimensional analysis support

Created with MrDocs