toml::date struct

A local date.

Constructors, destructors, conversion operators

date() defaulted noexcept
Default constructor. Does not initialize the members.
template <typename Y, typename M, typename D>
date(Y y, M m, D d) constexpr noexcept
Constructs a date from individual date component values.

Public variables

uint16_t year
The year component.
uint8_t month
The month component, from 1 - 12.
uint8_t day
The day component, from 1 - 31.

Friends

auto operator!=(const date& lhs, const date& rhs) →  bool constexpr noexcept
Inequality operator.
auto operator<(const date& lhs, const date& rhs) →  bool constexpr noexcept
Less-than operator.
auto operator<<(std::ostream& lhs, const date& rhs) →  std::ostream&
Prints a date out to a stream as YYYY-MM-DD (per RFC 3339).
auto operator<=(const date& lhs, const date& rhs) →  bool constexpr noexcept
Less-than-or-equal-to operator.
auto operator==(const date& lhs, const date& rhs) →  bool constexpr noexcept
Equality operator.
auto operator>(const date& lhs, const date& rhs) →  bool constexpr noexcept
Greater-than operator.
auto operator>=(const date& lhs, const date& rhs) →  bool constexpr noexcept
Greater-than-or-equal-to operator.

Function documentation

std::ostream& operator<<(std::ostream& lhs, const date& rhs)

Prints a date out to a stream as YYYY-MM-DD (per RFC 3339).

std::cout << toml::date{ 1987, 3, 16 } << "\n";
1987-03-16