![]() |
Birth Generator 1.1.1
Procedural birth date generation for C++23
|
Return type for birth generation, holding all data fields. More...
#include <birthgen.hpp>
Public Member Functions | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this birth. | |
| std::string | date_string () const |
| ISO 8601 date string (YYYY-MM-DD). | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | country_code |
| ISO 3166-1 alpha-2 code. | |
| std::uint16_t | year {0} |
| Birth year. | |
| std::uint8_t | month {0} |
| Birth month (1–12). | |
| std::uint8_t | day {0} |
| Birth day (1–31). | |
| std::uint8_t | age {0} |
| Age in completed years. | |
| sex | bio_sex {sex::male} |
| Biological sex. | |
| std::uint8_t | weekday {0} |
| Day of week (0=Sun, 1=Mon, …, 6=Sat). | |
| double | le_remaining {0.0} |
| Estimated years of life remaining. | |
| std::string | cohort |
| Generational cohort label. | |
Friends | |
| class | bthg |
| std::ostream & | operator<< (std::ostream &os, const birth &b) |
| Stream the ISO date to an output stream. | |
Return type for birth generation, holding all data fields.
Supports implicit conversion to std::string (returns ISO date) and streaming via operator<<.
Definition at line 74 of file birthgen.hpp.
|
inline |
ISO 8601 date string (YYYY-MM-DD).
Definition at line 91 of file birthgen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 101 of file birthgen.hpp.
|
inline |
Retrieve the random seed used to generate this birth.
Definition at line 88 of file birthgen.hpp.
|
friend |
Definition at line 115 of file birthgen.hpp.
|
friend |
Stream the ISO date to an output stream.
Definition at line 107 of file birthgen.hpp.
| std::uint8_t dasmig::birth::age {0} |
Age in completed years.
Definition at line 81 of file birthgen.hpp.
| sex dasmig::birth::bio_sex {sex::male} |
Biological sex.
Definition at line 82 of file birthgen.hpp.
| std::string dasmig::birth::cohort |
Generational cohort label.
Definition at line 85 of file birthgen.hpp.
| std::string dasmig::birth::country_code |
ISO 3166-1 alpha-2 code.
Definition at line 77 of file birthgen.hpp.
| std::uint8_t dasmig::birth::day {0} |
Birth day (1–31).
Definition at line 80 of file birthgen.hpp.
| double dasmig::birth::le_remaining {0.0} |
Estimated years of life remaining.
Definition at line 84 of file birthgen.hpp.
| std::uint8_t dasmig::birth::month {0} |
Birth month (1–12).
Definition at line 79 of file birthgen.hpp.
| std::uint8_t dasmig::birth::weekday {0} |
Day of week (0=Sun, 1=Mon, …, 6=Sat).
Definition at line 83 of file birthgen.hpp.
| std::uint16_t dasmig::birth::year {0} |
Birth year.
Definition at line 78 of file birthgen.hpp.