Introduce julian.h

This commit is contained in:
Howard Hinnant 2016-06-26 18:49:13 -04:00
parent d252405747
commit 7d1befb1db
3 changed files with 3051 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[![Join the chat at https://gitter.im/HowardHinnant/date](https://badges.gitter.im/HowardHinnant/date.svg)](https://gitter.im/HowardHinnant/date?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is actually three separate C++11/C++14 libraries:
This is actually several separate C++11/C++14 libraries:
1. `"date.h"` is a header-only library which builds upon `<chrono>`. It adds some new `duration` types, and new `time_point` types. It also adds "field" types such as `year_month_day` which is a struct `{year, month, day}`. And it provides convenient means to convert between the "field" types and the `time_point` types. See http://howardhinnant.github.io/date/date.html for more details.
@ -12,6 +12,8 @@ This is actually three separate C++11/C++14 libraries:
3. `"iso_week.h"` is a header-only library built on top of the `"date.h"` library which implements the ISO week date calendar. See http://howardhinnant.github.io/date/iso_week.html for more details.
4. `"julean.h"` is a header-only library built on top of the `"date.h"` library which implements a proleptic Julian calendar which is fully interoperable with everything above. See http://howardhinnant.github.io/date/julian.html for more details.
There has been a recent change in the library design. If you are trying to migrate from the previous design, rename `day_point` to `sys_days` everywhere, and that ought to bring the number of errors down to a small roar.
`"date.h"` and `"tz.h"` are now proposed for standardization here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0355r0.html

4
date.h
View File

@ -516,7 +516,7 @@ class month_weekday
date::weekday_indexed wdi_;
public:
CONSTCD11 month_weekday(const date::month& m,
const date::weekday_indexed& wdi) NOEXCEPT;
const date::weekday_indexed& wdi) NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::weekday_indexed weekday_indexed() const NOEXCEPT;
@ -567,7 +567,7 @@ class year_month_day
public:
CONSTCD11 year_month_day(const date::year& y, const date::month& m,
const date::day& d) NOEXCEPT;
const date::day& d) NOEXCEPT;
CONSTCD14 year_month_day(const year_month_day_last& ymdl) NOEXCEPT;
CONSTCD14 year_month_day(sys_days dp) NOEXCEPT;

3046
julian.h Normal file

File diff suppressed because it is too large Load Diff