5 Quantities library [qties]

5.3 Module mp_units.core synopsis [mp.units.core.syn]

export module mp_units.core; import std; export namespace mp_units { export enum class quantity_character { scalar, vector, tensor }; // [qty.traits], traits template<typename Rep> constexpr bool treat_as_floating_point = std::is_floating_point_v<Rep>; template<typename Rep> constexpr bool is_scalar = std::is_floating_point_v<Rep> || (std::is_integral_v<Rep> && !is_same_v<Rep, bool>); template<typename Rep> constexpr bool is_vector = false; template<typename Rep> constexpr bool is_tensor = false; template<typename Rep> struct quantity_values; template<typename T> struct quantity_like_traits; template<typename T> struct quantity_point_like_traits; // [qty.concepts], concepts template<typename T> concept some_reference = template_of(^std::remove_cvref_t<T>) == ^reference; template<typename T> concept representation = see below; template<typename T, quantity_character Ch> concept representation_of = see below; template<typename T> concept some_quantity_spec = see below; // [qty.types], types template<auto...> struct quantity_spec; // not defined template<auto Q> struct kind_of_; // not defined template<unspecified... Expr> struct derived_quantity_spec; // [qty.type], class template quantity export template<some_reference auto R, representation_of<get_quantity_spec(R).character> Rep = double> class quantity; // [qty.point.type], class template quantity_point template<unspecified> class quantity_point; }