mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 20:54:27 +02:00
Make to_stream and from_stream return a stream reference
This commit is contained in:
113
date.h
113
date.h
@@ -3398,13 +3398,13 @@ template <class Duration>
|
|||||||
struct fields;
|
struct fields;
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const fields<Duration>& fds, const std::string* abbrev = nullptr,
|
const fields<Duration>& fds, const std::string* abbrev = nullptr,
|
||||||
const std::chrono::seconds* offset_sec = nullptr);
|
const std::chrono::seconds* offset_sec = nullptr);
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration, class Alloc>
|
template <class CharT, class Traits, class Duration, class Alloc>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
fields<Duration>& fds, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
fields<Duration>& fds, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr);
|
std::chrono::minutes* offset = nullptr);
|
||||||
@@ -3950,14 +3950,14 @@ public:
|
|||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
friend
|
friend
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
date::to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
date::to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const fields<Duration>& fds, const std::string* abbrev,
|
const fields<Duration>& fds, const std::string* abbrev,
|
||||||
const std::chrono::seconds* offset_sec);
|
const std::chrono::seconds* offset_sec);
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration, class Alloc>
|
template <class CharT, class Traits, class Duration, class Alloc>
|
||||||
friend
|
friend
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
date::from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
date::from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
fields<Duration>& fds,
|
fields<Duration>& fds,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
|
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
|
||||||
@@ -4060,14 +4060,14 @@ public:
|
|||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
friend
|
friend
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
date::to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
date::to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const fields<Duration>& fds, const std::string* abbrev,
|
const fields<Duration>& fds, const std::string* abbrev,
|
||||||
const std::chrono::seconds* offset_sec);
|
const std::chrono::seconds* offset_sec);
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration, class Alloc>
|
template <class CharT, class Traits, class Duration, class Alloc>
|
||||||
friend
|
friend
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
date::from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
date::from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
fields<Duration>& fds,
|
fields<Duration>& fds,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
|
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
|
||||||
@@ -4242,7 +4242,7 @@ extract_weekday(std::basic_ostream<CharT, Traits>& os, const fields<Duration>& f
|
|||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const fields<Duration>& fds, const std::string* abbrev,
|
const fields<Duration>& fds, const std::string* abbrev,
|
||||||
const std::chrono::seconds* offset_sec)
|
const std::chrono::seconds* offset_sec)
|
||||||
@@ -4265,7 +4265,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
{
|
{
|
||||||
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
const CharT f[] = {'%', *fmt};
|
const CharT f[] = {'%', *fmt};
|
||||||
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
||||||
}
|
}
|
||||||
@@ -4319,7 +4319,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
||||||
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
||||||
CharT f[3] = {'%'};
|
CharT f[3] = {'%'};
|
||||||
auto fe = begin(f) + 1;
|
auto fe = begin(f) + 1;
|
||||||
@@ -4730,7 +4730,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
{
|
{
|
||||||
auto wd = detail::extract_weekday(os, fds);
|
auto wd = detail::extract_weekday(os, fds);
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
if (modified == CharT{'O'})
|
if (modified == CharT{'O'})
|
||||||
{
|
{
|
||||||
const CharT f[] = {'%', modified, *fmt};
|
const CharT f[] = {'%', modified, *fmt};
|
||||||
@@ -4763,7 +4763,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
||||||
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
||||||
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
||||||
modified = CharT{};
|
modified = CharT{};
|
||||||
@@ -4802,7 +4802,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
||||||
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
||||||
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
||||||
modified = CharT{};
|
modified = CharT{};
|
||||||
@@ -4836,7 +4836,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
{
|
{
|
||||||
auto wd = detail::extract_weekday(os, fds);
|
auto wd = detail::extract_weekday(os, fds);
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
if (modified == CharT{'O'})
|
if (modified == CharT{'O'})
|
||||||
{
|
{
|
||||||
const CharT f[] = {'%', modified, *fmt};
|
const CharT f[] = {'%', modified, *fmt};
|
||||||
@@ -4869,7 +4869,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
|
||||||
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
tm.tm_wday = static_cast<int>(detail::extract_weekday(os, fds));
|
||||||
if (os.fail())
|
if (os.fail())
|
||||||
return;
|
return os;
|
||||||
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year()/1/1)).count());
|
||||||
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
|
||||||
modified = CharT{};
|
modified = CharT{};
|
||||||
@@ -4976,7 +4976,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
{
|
{
|
||||||
// Can not format %z with unknown offset
|
// Can not format %z with unknown offset
|
||||||
os.setstate(ios::failbit);
|
os.setstate(ios::failbit);
|
||||||
return;
|
return os;
|
||||||
}
|
}
|
||||||
auto m = duration_cast<minutes>(*offset_sec);
|
auto m = duration_cast<minutes>(*offset_sec);
|
||||||
auto neg = m < minutes{0};
|
auto neg = m < minutes{0};
|
||||||
@@ -5010,7 +5010,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
{
|
{
|
||||||
// Can not format %Z with unknown time_zone
|
// Can not format %Z with unknown time_zone
|
||||||
os.setstate(ios::failbit);
|
os.setstate(ios::failbit);
|
||||||
return;
|
return os;
|
||||||
}
|
}
|
||||||
for (auto c : *abbrev)
|
for (auto c : *abbrev)
|
||||||
os << CharT(c);
|
os << CharT(c);
|
||||||
@@ -5080,93 +5080,94 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
os << CharT{'%'};
|
os << CharT{'%'};
|
||||||
if (modified != CharT{})
|
if (modified != CharT{})
|
||||||
os << modified;
|
os << modified;
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const year& y)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const year& y)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{y/0/0};
|
fields<CT> fds{y/0/0};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const month& m)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const month& m)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{m/0/0};
|
fields<CT> fds{m/0/0};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const day& d)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const day& d)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{d/0/0};
|
fields<CT> fds{d/0/0};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const weekday& wd)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const weekday& wd)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{wd};
|
fields<CT> fds{wd};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const year_month& ym)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const year_month& ym)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{ym/0};
|
fields<CT> fds{ym/0};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const month_day& md)
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const month_day& md)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{md/0};
|
fields<CT> fds{md/0};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const year_month_day& ymd)
|
const year_month_day& ymd)
|
||||||
{
|
{
|
||||||
using CT = std::chrono::seconds;
|
using CT = std::chrono::seconds;
|
||||||
fields<CT> fds{ymd};
|
fields<CT> fds{ymd};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Rep, class Period>
|
template <class CharT, class Traits, class Rep, class Period>
|
||||||
inline
|
inline
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const std::chrono::duration<Rep, Period>& d)
|
const std::chrono::duration<Rep, Period>& d)
|
||||||
{
|
{
|
||||||
using Duration = std::chrono::duration<Rep, Period>;
|
using Duration = std::chrono::duration<Rep, Period>;
|
||||||
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
|
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
|
||||||
fields<CT> fds{time_of_day<CT>{d}};
|
fields<CT> fds{time_of_day<CT>{d}};
|
||||||
to_stream(os, fmt, fds);
|
return to_stream(os, fmt, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const local_time<Duration>& tp, const std::string* abbrev = nullptr,
|
const local_time<Duration>& tp, const std::string* abbrev = nullptr,
|
||||||
const std::chrono::seconds* offset_sec = nullptr)
|
const std::chrono::seconds* offset_sec = nullptr)
|
||||||
@@ -5174,11 +5175,11 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
|
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
|
||||||
auto ld = floor<days>(tp);
|
auto ld = floor<days>(tp);
|
||||||
fields<CT> fds{year_month_day{ld}, time_of_day<CT>{tp-ld}};
|
fields<CT> fds{year_month_day{ld}, time_of_day<CT>{tp-ld}};
|
||||||
to_stream(os, fmt, fds, abbrev, offset_sec);
|
return to_stream(os, fmt, fds, abbrev, offset_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const sys_time<Duration>& tp)
|
const sys_time<Duration>& tp)
|
||||||
{
|
{
|
||||||
@@ -5187,7 +5188,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
CONSTDATA std::chrono::seconds offset{0};
|
CONSTDATA std::chrono::seconds offset{0};
|
||||||
auto sd = floor<days>(tp);
|
auto sd = floor<days>(tp);
|
||||||
fields<CT> fds{year_month_day{sd}, time_of_day<CT>{tp-sd}};
|
fields<CT> fds{year_month_day{sd}, time_of_day<CT>{tp-sd}};
|
||||||
to_stream(os, fmt, fds, &abbrev, &offset);
|
return to_stream(os, fmt, fds, &abbrev, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// format
|
// format
|
||||||
@@ -5474,7 +5475,7 @@ read(std::basic_istream<CharT, Traits>& is, rld a0, Args&& ...args)
|
|||||||
} // namespace detail;
|
} // namespace detail;
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Duration, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
fields<Duration>& fds, std::basic_string<CharT, Traits, Alloc>* abbrev,
|
fields<Duration>& fds, std::basic_string<CharT, Traits, Alloc>* abbrev,
|
||||||
std::chrono::minutes* offset)
|
std::chrono::minutes* offset)
|
||||||
@@ -6393,14 +6394,15 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
if (offset != nullptr)
|
if (offset != nullptr)
|
||||||
*offset = temp_offset;
|
*offset = temp_offset;
|
||||||
}
|
}
|
||||||
return;
|
return is;
|
||||||
}
|
}
|
||||||
broken:
|
broken:
|
||||||
is.setstate(ios_base::failbit);
|
is.setstate(ios_base::failbit);
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year& y,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year& y,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6414,10 +6416,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year& y,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
y = fds.ymd.year();
|
y = fds.ymd.year();
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month& m,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month& m,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6431,10 +6434,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month& m,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
m = fds.ymd.month();
|
m = fds.ymd.month();
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, day& d,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, day& d,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6448,10 +6452,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, day& d,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
d = fds.ymd.day();
|
d = fds.ymd.day();
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, weekday& wd,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, weekday& wd,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6465,10 +6470,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, weekday& wd
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
wd = fds.wd;
|
wd = fds.wd;
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year_month& ym,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year_month& ym,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6482,10 +6488,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, year_month&
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
ym = fds.ymd.year()/fds.ymd.month();
|
ym = fds.ymd.year()/fds.ymd.month();
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month_day& md,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month_day& md,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6499,10 +6506,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, month_day&
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
md = fds.ymd.month()/fds.ymd.day();
|
md = fds.ymd.month()/fds.ymd.day();
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
year_month_day& ymd, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
year_month_day& ymd, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6516,10 +6524,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
ymd = fds.ymd;
|
ymd = fds.ymd;
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
sys_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
sys_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6535,10 +6544,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
tp = sys_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration() - *offptr);
|
tp = sys_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration() - *offptr);
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
local_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
local_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -6552,10 +6562,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
tp = local_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration());
|
tp = local_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration());
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Rep, class Period, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Rep, class Period, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
std::chrono::duration<Rep, Period>& d,
|
std::chrono::duration<Rep, Period>& d,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
@@ -6569,6 +6580,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
from_stream(is, fmt, fds, abbrev, offset);
|
from_stream(is, fmt, fds, abbrev, offset);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
d = duration_cast<Duration>(fds.tod.to_duration());
|
d = duration_cast<Duration>(fds.tod.to_duration());
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Parsable, class CharT, class Traits = std::char_traits<CharT>,
|
template <class Parsable, class CharT, class Traits = std::char_traits<CharT>,
|
||||||
@@ -6597,8 +6609,7 @@ std::basic_istream<CharT, Traits>&
|
|||||||
operator>>(std::basic_istream<CharT, Traits>& is,
|
operator>>(std::basic_istream<CharT, Traits>& is,
|
||||||
const parse_manip<Parsable, CharT, Traits, Alloc>& x)
|
const parse_manip<Parsable, CharT, Traits, Alloc>& x)
|
||||||
{
|
{
|
||||||
from_stream(is, x.format_.c_str(), x.tp_, x.abbrev_, x.offset_);
|
return from_stream(is, x.format_.c_str(), x.tp_, x.abbrev_, x.offset_);
|
||||||
return is;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Parsable, class CharT, class Traits, class Alloc>
|
template <class Parsable, class CharT, class Traits, class Alloc>
|
||||||
@@ -7344,7 +7355,7 @@ struct make_string<wchar_t, Traits>
|
|||||||
{
|
{
|
||||||
template <class Rep>
|
template <class Rep>
|
||||||
static
|
static
|
||||||
std::wstring
|
std::basic_string<wchar_t, Traits>
|
||||||
from(Rep n)
|
from(Rep n)
|
||||||
{
|
{
|
||||||
auto s = std::to_wstring(n);
|
auto s = std::to_wstring(n);
|
||||||
|
39
tz.h
39
tz.h
@@ -1109,12 +1109,12 @@ make_zoned(const std::string& name, const sys_time<Duration>& st)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const zoned_time<Duration>& tp)
|
const zoned_time<Duration>& tp)
|
||||||
{
|
{
|
||||||
auto const info = tp.get_info();
|
auto const info = tp.get_info();
|
||||||
to_stream(os, fmt, tp.get_local_time(), &info.abbrev, &info.offset);
|
return to_stream(os, fmt, tp.get_local_time(), &info.abbrev, &info.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
@@ -1122,8 +1122,7 @@ inline
|
|||||||
std::basic_ostream<CharT, Traits>&
|
std::basic_ostream<CharT, Traits>&
|
||||||
operator<<(std::basic_ostream<CharT, Traits>& os, const zoned_time<Duration>& t)
|
operator<<(std::basic_ostream<CharT, Traits>& os, const zoned_time<Duration>& t)
|
||||||
{
|
{
|
||||||
to_stream(os, "%F %T %Z", t);
|
return to_stream(os, "%F %T %Z", t);
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MISSING_LEAP_SECONDS
|
#if !MISSING_LEAP_SECONDS
|
||||||
@@ -1209,7 +1208,7 @@ utc_clock::now()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const utc_time<Duration>& t)
|
const utc_time<Duration>& t)
|
||||||
{
|
{
|
||||||
@@ -1225,19 +1224,18 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
auto time = make_time(tp - sd);
|
auto time = make_time(tp - sd);
|
||||||
time.seconds() += seconds{ls.first};
|
time.seconds() += seconds{ls.first};
|
||||||
fields<CT> fds{ymd, time};
|
fields<CT> fds{ymd, time};
|
||||||
to_stream(os, fmt, fds, &abbrev, &offset);
|
return to_stream(os, fmt, fds, &abbrev, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
std::basic_ostream<CharT, Traits>&
|
std::basic_ostream<CharT, Traits>&
|
||||||
operator<<(std::basic_ostream<CharT, Traits>& os, const utc_time<Duration>& t)
|
operator<<(std::basic_ostream<CharT, Traits>& os, const utc_time<Duration>& t)
|
||||||
{
|
{
|
||||||
to_stream(os, "%F %T", t);
|
return to_stream(os, "%F %T", t);
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
utc_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
utc_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
std::chrono::minutes* offset = nullptr)
|
std::chrono::minutes* offset = nullptr)
|
||||||
@@ -1262,10 +1260,11 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
if (is_60_sec != is_leap_second(tmp).first || !fds.tod.in_conventional_range())
|
if (is_60_sec != is_leap_second(tmp).first || !fds.tod.in_conventional_range())
|
||||||
{
|
{
|
||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
return;
|
return is;
|
||||||
}
|
}
|
||||||
tp = time_point_cast<Duration>(tmp);
|
tp = time_point_cast<Duration>(tmp);
|
||||||
}
|
}
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tai_clock
|
// tai_clock
|
||||||
@@ -1326,7 +1325,7 @@ tai_clock::now() NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const tai_time<Duration>& t)
|
const tai_time<Duration>& t)
|
||||||
{
|
{
|
||||||
@@ -1341,19 +1340,18 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
year_month_day ymd = sd;
|
year_month_day ymd = sd;
|
||||||
auto time = make_time(tp - sd);
|
auto time = make_time(tp - sd);
|
||||||
fields<CT> fds{ymd, time};
|
fields<CT> fds{ymd, time};
|
||||||
to_stream(os, fmt, fds, &abbrev, &offset);
|
return to_stream(os, fmt, fds, &abbrev, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
std::basic_ostream<CharT, Traits>&
|
std::basic_ostream<CharT, Traits>&
|
||||||
operator<<(std::basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t)
|
operator<<(std::basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t)
|
||||||
{
|
{
|
||||||
to_stream(os, "%F %T", t);
|
return to_stream(os, "%F %T", t);
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
tai_time<Duration>& tp,
|
tai_time<Duration>& tp,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
@@ -1372,6 +1370,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
tp = tai_time<Duration>{duration_cast<Duration>(
|
tp = tai_time<Duration>{duration_cast<Duration>(
|
||||||
(sys_days(fds.ymd) + fds.tod.to_duration() + (sys_days(year{1970}/jan/1) -
|
(sys_days(fds.ymd) + fds.tod.to_duration() + (sys_days(year{1970}/jan/1) -
|
||||||
sys_days(year{1958}/jan/1)) - *offptr).time_since_epoch())};
|
sys_days(year{1958}/jan/1)) - *offptr).time_since_epoch())};
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
// gps_clock
|
// gps_clock
|
||||||
@@ -1432,7 +1431,7 @@ gps_clock::now() NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
void
|
std::basic_ostream<CharT, Traits>&
|
||||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||||
const gps_time<Duration>& t)
|
const gps_time<Duration>& t)
|
||||||
{
|
{
|
||||||
@@ -1447,19 +1446,18 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
|||||||
year_month_day ymd = sd;
|
year_month_day ymd = sd;
|
||||||
auto time = make_time(tp - sd);
|
auto time = make_time(tp - sd);
|
||||||
fields<CT> fds{ymd, time};
|
fields<CT> fds{ymd, time};
|
||||||
to_stream(os, fmt, fds, &abbrev, &offset);
|
return to_stream(os, fmt, fds, &abbrev, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Duration>
|
template <class CharT, class Traits, class Duration>
|
||||||
std::basic_ostream<CharT, Traits>&
|
std::basic_ostream<CharT, Traits>&
|
||||||
operator<<(std::basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t)
|
operator<<(std::basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t)
|
||||||
{
|
{
|
||||||
to_stream(os, "%F %T", t);
|
return to_stream(os, detail::make_string<CharT, Traits>::from("%F %T").c_str(), t);
|
||||||
return os;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
|
||||||
void
|
std::basic_istream<CharT, Traits>&
|
||||||
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||||
gps_time<Duration>& tp,
|
gps_time<Duration>& tp,
|
||||||
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
|
||||||
@@ -1479,6 +1477,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
(sys_days(fds.ymd) + fds.tod.to_duration() -
|
(sys_days(fds.ymd) + fds.tod.to_duration() -
|
||||||
(sys_days(year{1980}/jan/sun[1]) -
|
(sys_days(year{1980}/jan/sun[1]) -
|
||||||
sys_days(year{1970}/jan/1)) - *offptr).time_since_epoch())};
|
sys_days(year{1970}/jan/1)) - *offptr).time_since_epoch())};
|
||||||
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
|
Reference in New Issue
Block a user