util::quantities::time_literals Namespace Reference

Literal constants for time quantities. More...

Functions

constexpr second operator""_s (long double v)
 Literal second value. More...
 
constexpr second operator""_s (unsigned long long int v)
 
constexpr millisecond operator""_ms (long double v)
 Literal millisecond value. More...
 
constexpr millisecond operator""_ms (unsigned long long int v)
 
constexpr microsecond operator""_us (long double v)
 Literal microsecond value. More...
 
constexpr microsecond operator""_us (unsigned long long int v)
 
constexpr nanosecond operator""_ns (long double v)
 Literal nanosecond value. More...
 
constexpr nanosecond operator""_ns (unsigned long long int v)
 
constexpr picosecond operator""_ps (long double v)
 Literal picosecond value. More...
 
constexpr picosecond operator""_ps (unsigned long long int v)
 

Detailed Description

Literal constants for time quantities.

These functions allow a simplified syntax for specifying a time quantity. In order to use these, their namespace must be used:

// definition of `util::quantities::second` constant:
constexpr auto t_s = 12_s;
// assignment (likely to a quantity) of
// `util::quantities::millisecond{500.0}`
t_s = 500_ms;

Function Documentation

constexpr millisecond util::quantities::time_literals::operator""_ms ( long double  v)

Literal millisecond value.

Definition at line 187 of file spacetime.h.

188  { return millisecond{ static_cast<double>(v) }; }
millisecond_as<> millisecond
Type of time point stored in milliseconds, in double precision.
Definition: spacetime.h:317
constexpr millisecond util::quantities::time_literals::operator""_ms ( unsigned long long int  v)

Definition at line 189 of file spacetime.h.

190  { return millisecond{ static_cast<double>(v) }; }
millisecond_as<> millisecond
Type of time point stored in milliseconds, in double precision.
Definition: spacetime.h:317
constexpr nanosecond util::quantities::time_literals::operator""_ns ( long double  v)

Literal nanosecond value.

Definition at line 203 of file spacetime.h.

204  { return nanosecond{ static_cast<double>(v) }; }
nanosecond_as<> nanosecond
Type of time point stored in nanoseconds, in double precision.
Definition: spacetime.h:339
constexpr nanosecond util::quantities::time_literals::operator""_ns ( unsigned long long int  v)

Definition at line 205 of file spacetime.h.

206  { return nanosecond{ static_cast<double>(v) }; }
nanosecond_as<> nanosecond
Type of time point stored in nanoseconds, in double precision.
Definition: spacetime.h:339
constexpr picosecond util::quantities::time_literals::operator""_ps ( long double  v)

Literal picosecond value.

Definition at line 211 of file spacetime.h.

212  { return picosecond{ static_cast<double>(v) }; }
picosecond_as<> picosecond
Type of time point stored in picoseconds, in double precision.
Definition: spacetime.h:350
constexpr picosecond util::quantities::time_literals::operator""_ps ( unsigned long long int  v)

Definition at line 213 of file spacetime.h.

214  { return picosecond{ static_cast<double>(v) }; }
picosecond_as<> picosecond
Type of time point stored in picoseconds, in double precision.
Definition: spacetime.h:350
constexpr second util::quantities::time_literals::operator""_s ( long double  v)

Literal second value.

Definition at line 179 of file spacetime.h.

180  { return second{ static_cast<double>(v) }; }
second_as<> second
Type of time point stored in seconds, in double precision.
Definition: spacetime.h:306
constexpr second util::quantities::time_literals::operator""_s ( unsigned long long int  v)

Definition at line 181 of file spacetime.h.

182  { return second{ static_cast<double>(v) }; }
second_as<> second
Type of time point stored in seconds, in double precision.
Definition: spacetime.h:306
constexpr microsecond util::quantities::time_literals::operator""_us ( long double  v)

Literal microsecond value.

Definition at line 195 of file spacetime.h.

196  { return microsecond{ static_cast<double>(v) }; }
microsecond_as<> microsecond
Type of time point stored in microseconds, in double precision.
Definition: spacetime.h:328
constexpr microsecond util::quantities::time_literals::operator""_us ( unsigned long long int  v)

Definition at line 197 of file spacetime.h.

198  { return microsecond{ static_cast<double>(v) }; }
microsecond_as<> microsecond
Type of time point stored in microseconds, in double precision.
Definition: spacetime.h:328