Quantity Factory Functions

Convenience functions for creating quantities with compile-time units

Context

_images/ditaa-8403fa66acef33ca91cef45ab20b9810035d93a5.png

Introduction

#include <xo/unit/quantity.hpp>

Mass

template<typename Repr>
inline auto xo::qty::qty::picograms(Repr x)

create quantity representing x picograms of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::nanograms(Repr x)

create quantity representing x nanograms of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::micrograms(Repr x)

create quantity representing x micrograms of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::milligrams(Repr x)

create quantity representing x milligrams of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::grams(Repr x)

create quantity representing x grams of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::kilograms(Repr x)

create quantity representing x kilograms of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::tonnes(Repr x)

create quantity representing x tonnes of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::kilotonnes(Repr x)

create quantity representing x kilotonnes of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::megatonnes(Repr x)

create quantity representing x megatonnes of mass, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::gigatonnes(Repr x)

create quantity representing x gigatonnes of mass, with compile-time unit representation

Distance

template<typename Repr>
inline auto xo::qty::qty::picometers(Repr x)

create quantity representing x picometers of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::nanometers(Repr x)

create quantity representing x nanometers of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::micrometers(Repr x)

create quantity representing x micrometers of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::millimeters(Repr x)

create quantity representing x millimeters of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::meters(Repr x)

create quantity representing x meters of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::kilometers(Repr x)

create quantity representing x kilometers of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::megameters(Repr x)

create quantity representing x megameters of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::gigameters(Repr x)

create quantity representing x gigameters of distance, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::lightseconds(Repr x)

create quantity representing x light-seconds of distance, with compile-time unit operations.

template<typename Repr>
inline auto xo::qty::qty::astronomicalunits(Repr x)

create quantity representing x astronomical units of distance, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::inches(Repr x)

create quantity representing x inches of distance, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::feet(Repr x)

create quantity representing x feet of distance, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::yards(Repr x)

create quantity representing x yards of distance, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::miles(Repr x)

create quantity representing x statute miles of distance, with compile-time unit representation

Time

template<typename Repr>
inline auto xo::qty::qty::picoseconds(Repr x)

create quantity representing x picoseconds of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::nanoseconds(Repr x)

create quantity representing x nanoseconds of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::microseconds(Repr x)

create quantity representing x microseconds of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::milliseconds(Repr x)

create quantity representing x milliseconds of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::seconds(Repr x)

create quantity representing x seconds of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::minutes(Repr x)

create quantity representing x minutes of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::hours(Repr x)

create quantity representing x hours of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::days(Repr x)

create quantity representing x exactly-24-hour days of time, with compile-time unit operations

template<typename Repr>
inline auto xo::qty::qty::weeks(Repr x)

creeate quantity representing x weeks of time, with compile-time unit operations. Each week has exactly 7 24-hour days.

template<typename Repr>
inline auto xo::qty::qty::months(Repr x)

create quantity representing x months of time, with compile-time unit operations. Each month has exactly 30 24-hour days

template<typename Repr>
inline auto xo::qty::qty::years(Repr x)

create quantity representing x years of time, with compile-time unit operations. Each year has exactly 365.25 24-hour days

template<typename Repr>
inline auto xo::qty::qty::year250s(Repr x)

create quantity representing x ‘250-day years’ of time. 250 represents approximate number of business days in a calendar year.

template<typename Repr>
inline auto xo::qty::qty::year360s(Repr x)

create quantity representing x ‘360-day years’ of time

template<typename Repr>
inline auto xo::qty::qty::year365s(Repr x)

create quantity representing x ‘365-day years’ of time

Volatility

template<typename Repr>
inline auto xo::qty::qty::volatility_30d(Repr x)

create quantity representing x units of 30-day volatility, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::volatility_250d(Repr x)

create quantity representing x units of 250-day volatility, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::volatility_360d(Repr x)

create quantity representing x units of 360-day volatility, with compile-time unit representation

template<typename Repr>
inline auto xo::qty::qty::volatility_365d(Repr x)

create quantity representing x units of 365-day volatility, with compile-time unit representation