LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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)
 Literal second value. More...
 
constexpr millisecond operator""_ms (long double v)
 Literal millisecond value. More...
 
constexpr millisecond operator""_ms (unsigned long long int v)
 Literal millisecond value. More...
 
constexpr microsecond operator""_us (long double v)
 Literal microsecond value. More...
 
constexpr microsecond operator""_us (unsigned long long int v)
 Literal microsecond value. More...
 
constexpr nanosecond operator""_ns (long double v)
 Literal nanosecond value. More...
 
constexpr nanosecond operator""_ns (unsigned long long int v)
 Literal nanosecond value. More...
 
constexpr picosecond operator""_ps (long double v)
 Literal picosecond value. More...
 
constexpr picosecond operator""_ps (unsigned long long int v)
 Literal picosecond value. More...
 

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 188 of file spacetime.h.

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

Literal millisecond value.

Definition at line 192 of file spacetime.h.

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

Literal nanosecond value.

Definition at line 212 of file spacetime.h.

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

Literal nanosecond value.

Definition at line 216 of file spacetime.h.

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

Literal picosecond value.

Definition at line 224 of file spacetime.h.

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

Literal picosecond value.

Definition at line 228 of file spacetime.h.

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

Literal second value.

Definition at line 176 of file spacetime.h.

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

Literal second value.

Definition at line 180 of file spacetime.h.

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

Literal microsecond value.

Definition at line 200 of file spacetime.h.

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

Literal microsecond value.

Definition at line 204 of file spacetime.h.

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