mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 20:54:27 +02:00
Make time_of_day default constructor non-explicit.
Add zoned_time const char* overloaded constructor.
This commit is contained in:
21
date.h
21
date.h
@@ -3688,7 +3688,7 @@ class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::
|
|||||||
public:
|
public:
|
||||||
using precision = std::chrono::hours;
|
using precision = std::chrono::hours;
|
||||||
|
|
||||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT = default;
|
CONSTCD11 time_of_day_storage() NOEXCEPT = default;
|
||||||
|
|
||||||
CONSTCD11 explicit time_of_day_storage(std::chrono::hours since_midnight) NOEXCEPT
|
CONSTCD11 explicit time_of_day_storage(std::chrono::hours since_midnight) NOEXCEPT
|
||||||
: base(since_midnight, since_midnight < std::chrono::hours{0}, is24hr)
|
: base(since_midnight, since_midnight < std::chrono::hours{0}, is24hr)
|
||||||
@@ -3758,7 +3758,7 @@ class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::
|
|||||||
public:
|
public:
|
||||||
using precision = std::chrono::minutes;
|
using precision = std::chrono::minutes;
|
||||||
|
|
||||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||||
: base()
|
: base()
|
||||||
, m_(0)
|
, m_(0)
|
||||||
{}
|
{}
|
||||||
@@ -3837,7 +3837,7 @@ class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::
|
|||||||
public:
|
public:
|
||||||
using precision = std::chrono::seconds;
|
using precision = std::chrono::seconds;
|
||||||
|
|
||||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||||
: base()
|
: base()
|
||||||
, m_(0)
|
, m_(0)
|
||||||
, s_()
|
, s_()
|
||||||
@@ -3939,7 +3939,7 @@ private:
|
|||||||
dfs s_;
|
dfs s_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||||
: base()
|
: base()
|
||||||
, m_(0)
|
, m_(0)
|
||||||
, s_()
|
, s_()
|
||||||
@@ -4035,8 +4035,17 @@ class time_of_day
|
|||||||
using base = detail::time_of_day_storage<Duration>;
|
using base = detail::time_of_day_storage<Duration>;
|
||||||
public:
|
public:
|
||||||
#if !(defined(_MSC_VER) && !defined(__clang__))
|
#if !(defined(_MSC_VER) && !defined(__clang__))
|
||||||
// C++11
|
CONSTCD11 time_of_day() NOEXCEPT = default;
|
||||||
using base::base;
|
|
||||||
|
CONSTCD11 explicit time_of_day(Duration since_midnight) NOEXCEPT
|
||||||
|
: base(since_midnight)
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <class Arg0, class Arg1, class ...Args>
|
||||||
|
CONSTCD11
|
||||||
|
explicit time_of_day(Arg0&& arg0, Arg1&& arg1, Args&& ...args) NOEXCEPT
|
||||||
|
: base(std::forward<Arg0>(arg0), std::forward<Arg1>(arg1), std::forward<Args>(args)...)
|
||||||
|
{}
|
||||||
#else
|
#else
|
||||||
// MS cl compiler workaround.
|
// MS cl compiler workaround.
|
||||||
template <class ...Args>
|
template <class ...Args>
|
||||||
|
44
tz.h
44
tz.h
@@ -284,16 +284,21 @@ public:
|
|||||||
|
|
||||||
zoned_time(const time_zone* z, const local_time<Duration>& tp);
|
zoned_time(const time_zone* z, const local_time<Duration>& tp);
|
||||||
zoned_time(const std::string& name, const local_time<Duration>& tp);
|
zoned_time(const std::string& name, const local_time<Duration>& tp);
|
||||||
|
zoned_time(const char* name, const local_time<Duration>& tp);
|
||||||
zoned_time(const time_zone* z, const local_time<Duration>& tp, choose c);
|
zoned_time(const time_zone* z, const local_time<Duration>& tp, choose c);
|
||||||
zoned_time(const std::string& name, const local_time<Duration>& tp, choose c);
|
zoned_time(const std::string& name, const local_time<Duration>& tp, choose c);
|
||||||
|
zoned_time(const char* name, const local_time<Duration>& tp, choose c);
|
||||||
|
|
||||||
zoned_time(const time_zone* z, const zoned_time<Duration>& zt);
|
zoned_time(const time_zone* z, const zoned_time<Duration>& zt);
|
||||||
zoned_time(const std::string& name, const zoned_time<Duration>& zt);
|
zoned_time(const std::string& name, const zoned_time<Duration>& zt);
|
||||||
|
zoned_time(const char* name, const zoned_time<Duration>& zt);
|
||||||
zoned_time(const time_zone* z, const zoned_time<Duration>& zt, choose);
|
zoned_time(const time_zone* z, const zoned_time<Duration>& zt, choose);
|
||||||
zoned_time(const std::string& name, const zoned_time<Duration>& zt, choose);
|
zoned_time(const std::string& name, const zoned_time<Duration>& zt, choose);
|
||||||
|
zoned_time(const char* name, const zoned_time<Duration>& zt, choose);
|
||||||
|
|
||||||
zoned_time(const time_zone* z, const sys_time<Duration>& st);
|
zoned_time(const time_zone* z, const sys_time<Duration>& st);
|
||||||
zoned_time(const std::string& name, const sys_time<Duration>& st);
|
zoned_time(const std::string& name, const sys_time<Duration>& st);
|
||||||
|
zoned_time(const char* name, const sys_time<Duration>& st);
|
||||||
|
|
||||||
zoned_time& operator=(const sys_time<Duration>& st);
|
zoned_time& operator=(const sys_time<Duration>& st);
|
||||||
zoned_time& operator=(const local_time<Duration>& ut);
|
zoned_time& operator=(const local_time<Duration>& ut);
|
||||||
@@ -806,6 +811,14 @@ zoned_time<Duration>::zoned_time(const std::string& name)
|
|||||||
: zoned_time(locate_zone(name))
|
: zoned_time(locate_zone(name))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
template <class Duration>
|
||||||
|
template <class Duration2, class>
|
||||||
|
inline
|
||||||
|
zoned_time<Duration>::zoned_time(const zoned_time<Duration2>& zt) NOEXCEPT
|
||||||
|
: zone_(zt.zone_)
|
||||||
|
, tp_(zt.tp_)
|
||||||
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
inline
|
inline
|
||||||
zoned_time<Duration>::zoned_time(const time_zone* z, const local_time<Duration>& t)
|
zoned_time<Duration>::zoned_time(const time_zone* z, const local_time<Duration>& t)
|
||||||
@@ -819,6 +832,12 @@ zoned_time<Duration>::zoned_time(const std::string& name, const local_time<Durat
|
|||||||
: zoned_time(locate_zone(name), t)
|
: zoned_time(locate_zone(name), t)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
template <class Duration>
|
||||||
|
inline
|
||||||
|
zoned_time<Duration>::zoned_time(const char* name, const local_time<Duration>& t)
|
||||||
|
: zoned_time(locate_zone(name), t)
|
||||||
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
inline
|
inline
|
||||||
zoned_time<Duration>::zoned_time(const time_zone* z, const local_time<Duration>& t,
|
zoned_time<Duration>::zoned_time(const time_zone* z, const local_time<Duration>& t,
|
||||||
@@ -835,11 +854,10 @@ zoned_time<Duration>::zoned_time(const std::string& name, const local_time<Durat
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
template <class Duration2, class>
|
|
||||||
inline
|
inline
|
||||||
zoned_time<Duration>::zoned_time(const zoned_time<Duration2>& zt) NOEXCEPT
|
zoned_time<Duration>::zoned_time(const char* name, const local_time<Duration>& t,
|
||||||
: zone_(zt.zone_)
|
choose c)
|
||||||
, tp_(zt.tp_)
|
: zoned_time(locate_zone(name), t, c)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
@@ -855,6 +873,12 @@ zoned_time<Duration>::zoned_time(const std::string& name, const zoned_time<Durat
|
|||||||
: zoned_time(locate_zone(name), zt)
|
: zoned_time(locate_zone(name), zt)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
template <class Duration>
|
||||||
|
inline
|
||||||
|
zoned_time<Duration>::zoned_time(const char* name, const zoned_time<Duration>& zt)
|
||||||
|
: zoned_time(locate_zone(name), zt)
|
||||||
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
inline
|
inline
|
||||||
zoned_time<Duration>::zoned_time(const time_zone* z, const zoned_time<Duration>& zt, choose)
|
zoned_time<Duration>::zoned_time(const time_zone* z, const zoned_time<Duration>& zt, choose)
|
||||||
@@ -868,6 +892,13 @@ zoned_time<Duration>::zoned_time(const std::string& name,
|
|||||||
: zoned_time(locate_zone(name), zt, c)
|
: zoned_time(locate_zone(name), zt, c)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
template <class Duration>
|
||||||
|
inline
|
||||||
|
zoned_time<Duration>::zoned_time(const char* name,
|
||||||
|
const zoned_time<Duration>& zt, choose c)
|
||||||
|
: zoned_time(locate_zone(name), zt, c)
|
||||||
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
inline
|
inline
|
||||||
zoned_time<Duration>::zoned_time(const time_zone* z, const sys_time<Duration>& st)
|
zoned_time<Duration>::zoned_time(const time_zone* z, const sys_time<Duration>& st)
|
||||||
@@ -881,6 +912,11 @@ zoned_time<Duration>::zoned_time(const std::string& name, const sys_time<Duratio
|
|||||||
: zoned_time(locate_zone(name), st)
|
: zoned_time(locate_zone(name), st)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
template <class Duration>
|
||||||
|
inline
|
||||||
|
zoned_time<Duration>::zoned_time(const char* name, const sys_time<Duration>& st)
|
||||||
|
: zoned_time(locate_zone(name), st)
|
||||||
|
{}
|
||||||
|
|
||||||
template <class Duration>
|
template <class Duration>
|
||||||
inline
|
inline
|
||||||
|
Reference in New Issue
Block a user