struct
time_offsetA timezone offset.
Constructors, destructors, conversion operators
- time_offset() defaulted noexcept
- Default constructor. Does not initialize the members.
-
template <typename H, typename M>time_offset(H h, M m) constexpr noexcept
- Constructs a timezone offset from individual hour and minute totals.
Public variables
Friends
-
auto operator!=(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Inequality operator.
-
auto operator<(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Less-than operator.
-
auto operator<<(std::
ostream& lhs, const time_ offset& rhs) → std:: ostream& - Prints a time_
offset out to a stream as +-HH:MM or Z
(per RFC 3339). -
auto operator<=(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Less-than-or-equal-to operator.
-
auto operator==(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Equality operator.
-
auto operator>(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Greater-than operator.
-
auto operator>=(time_
offset lhs, time_ offset rhs) → bool constexpr noexcept - Greater-than-or-equal-to operator.
Function documentation
template <typename H, typename M>
toml:: time_offset:: time_offset(H h,
M m) constexpr noexcept
Constructs a timezone offset from individual hour and minute totals.
Template parameters | |
---|---|
H | An integral type. |
M | An integral type. |
Parameters | |
h | The total hours. |
m | The total minutes. |
std::cout << toml::time_offset{ 2, 30 } << "\n"; std::cout << toml::time_offset{ -2, 30 } << "\n"; std::cout << toml::time_offset{ -2, -30 } << "\n"; std::cout << toml::time_offset{ 0, 0 } << "\n";
+02:30 -01:30 -02:30 Z
std:: ostream& operator<<(std:: ostream& lhs,
const time_ offset& rhs)
Prints a time_+-HH:MM or Z
(per RFC 3339).
std::cout << toml::time_offset{ 2, 30 } << "\n"; std::cout << toml::time_offset{ 2, -30 } << "\n"; std::cout << toml::time_offset{} << "\n"; std::cout << toml::time_offset{ -2, 30 } << "\n"; std::cout << toml::time_offset{ -2, -30 } << "\n";
+02:30 +01:30 Z -01:30 -02:30