Unit Conversion and Dimensional Analysis Library  2.3.0
A compile-time c++14 unit conversion library
Public Types | Static Public Member Functions | List of all members
units::unit_value_t< Units, Num, Denom > Struct Template Reference

Stores a rational unit value as a compile-time constant. More...

#include <units.h>

Inheritance diagram for units::unit_value_t< Units, Num, Denom >:

Public Types

typedef Units unit_type
 
typedef std::ratio< Num, Denom > ratio
 

Static Public Member Functions

static constexpr const unit_t< Units > value ()
 

Detailed Description

template<typename Units, std::uintmax_t Num, std::uintmax_t Denom = 1>
struct units::unit_value_t< Units, Num, Denom >

Stores a rational unit value as a compile-time constant.

unit_value_t is useful for performing compile-time arithmetic on known unit quantities.

Template Parameters
Unitsunits represented by the unit_value_t
Numnumerator of the represented value.
Denomdenominator of the represented value.
See also
unit_value_t_traits to access information about the properties of the class, such as it's unit type and rational value.
Note
This is intentionally identical in concept to a std::ratio.

The documentation for this struct was generated from the following file: