mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-01 11:44:26 +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:
|
||||
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
|
||||
: 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:
|
||||
using precision = std::chrono::minutes;
|
||||
|
||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
||||
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||
: base()
|
||||
, m_(0)
|
||||
{}
|
||||
@@ -3837,7 +3837,7 @@ class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::
|
||||
public:
|
||||
using precision = std::chrono::seconds;
|
||||
|
||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
||||
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||
: base()
|
||||
, m_(0)
|
||||
, s_()
|
||||
@@ -3939,7 +3939,7 @@ private:
|
||||
dfs s_;
|
||||
|
||||
public:
|
||||
CONSTCD11 explicit time_of_day_storage() NOEXCEPT
|
||||
CONSTCD11 time_of_day_storage() NOEXCEPT
|
||||
: base()
|
||||
, m_(0)
|
||||
, s_()
|
||||
@@ -4035,8 +4035,17 @@ class time_of_day
|
||||
using base = detail::time_of_day_storage<Duration>;
|
||||
public:
|
||||
#if !(defined(_MSC_VER) && !defined(__clang__))
|
||||
// C++11
|
||||
using base::base;
|
||||
CONSTCD11 time_of_day() NOEXCEPT = default;
|
||||
|
||||
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
|
||||
// MS cl compiler workaround.
|
||||
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 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 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 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 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 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 local_time<Duration>& ut);
|
||||
@@ -806,6 +811,14 @@ zoned_time<Duration>::zoned_time(const std::string& 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>
|
||||
inline
|
||||
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)
|
||||
{}
|
||||
|
||||
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>
|
||||
inline
|
||||
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 Duration2, class>
|
||||
inline
|
||||
zoned_time<Duration>::zoned_time(const zoned_time<Duration2>& zt) NOEXCEPT
|
||||
: zone_(zt.zone_)
|
||||
, tp_(zt.tp_)
|
||||
zoned_time<Duration>::zoned_time(const char* name, const local_time<Duration>& t,
|
||||
choose c)
|
||||
: zoned_time(locate_zone(name), t, c)
|
||||
{}
|
||||
|
||||
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)
|
||||
{}
|
||||
|
||||
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>
|
||||
inline
|
||||
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)
|
||||
{}
|
||||
|
||||
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>
|
||||
inline
|
||||
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)
|
||||
{}
|
||||
|
||||
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>
|
||||
inline
|
||||
|
Reference in New Issue
Block a user