WPILibC++ 2023.4.3
Unit Types

Defines a series of classes which represent units. More...

Classes

struct  units::base_unit< Meter, Kilogram, Second, Radian, Ampere, Kelvin, Mole, Candela, Byte >
 Class representing SI base unit types. More...
 
struct  units::unit< Conversion, BaseUnit, PiExponent, Translation >
 Type representing an arbitrary unit. More...
 

Typedefs

template<class U , class... Us>
using units::compound_unit = typename units::detail::compound_impl< U, Us... >::type
 Represents a unit type made up from other units. More...
 

Detailed Description

Defines a series of classes which represent units.

These types are tags used by the conversion function, to create compound units, or to create unit_t types. By themselves, they are not containers and have no stored value.

Typedef Documentation

◆ compound_unit

template<class U , class... Us>
using units::compound_unit = typedef typename units::detail::compound_impl<U, Us...>::type

Represents a unit type made up from other units.

Compound units are formed by multiplying the units of all the types provided in the template argument. Types provided must inherit from unit. A compound unit can be formed from any number of other units, and unit manipulators like inverse and squared are supported. E.g. to specify acceleration, on could create using acceleration = compound_unit<length::meters, inverse<squared<seconds>>;

Template Parameters
U...units which, when multiplied together, form the desired compound unit.