WPILibC++ 2023.4.3-108-ge5452e3
units::unit_value_t< Units, Num, Denom > Struct Template Reference

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

#include <units/base.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.

Member Typedef Documentation

◆ ratio

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

◆ unit_type

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

Member Function Documentation

◆ value()

template<typename Units , std::uintmax_t Num, std::uintmax_t Denom = 1>
static constexpr const unit_t< Units > units::unit_value_t< Units, Num, Denom >::value ( )
inlinestaticconstexpr

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