mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-26 07:53:16 +08:00
Add to_duration() to time_of_day:
* This is a synonym for static_cast<precision>(*this). * This variation can be easier to spell when the precision is not conveniently available.
This commit is contained in:
parent
33f923b508
commit
2d115a8022
20
date.h
20
date.h
@ -3096,6 +3096,11 @@ public:
|
||||
return to24hr();
|
||||
}
|
||||
|
||||
CONSTCD14 precision to_duration() const noexcept
|
||||
{
|
||||
return static_cast<precision>(*this);
|
||||
}
|
||||
|
||||
CONSTCD14 time_of_day_storage& make24() noexcept {base::make24(); return *this;}
|
||||
CONSTCD14 time_of_day_storage& make12() noexcept {base::make12(); return *this;}
|
||||
|
||||
@ -3157,6 +3162,11 @@ public:
|
||||
return to24hr() + m_;
|
||||
}
|
||||
|
||||
CONSTCD14 precision to_duration() const noexcept
|
||||
{
|
||||
return static_cast<precision>(*this);
|
||||
}
|
||||
|
||||
CONSTCD14 time_of_day_storage& make24() noexcept {base::make24(); return *this;}
|
||||
CONSTCD14 time_of_day_storage& make12() noexcept {base::make12(); return *this;}
|
||||
|
||||
@ -3223,6 +3233,11 @@ public:
|
||||
return to24hr() + m_ + s_;
|
||||
}
|
||||
|
||||
CONSTCD14 precision to_duration() const noexcept
|
||||
{
|
||||
return static_cast<precision>(*this);
|
||||
}
|
||||
|
||||
CONSTCD14 time_of_day_storage& make24() noexcept {base::make24(); return *this;}
|
||||
CONSTCD14 time_of_day_storage& make12() noexcept {base::make12(); return *this;}
|
||||
|
||||
@ -3298,6 +3313,11 @@ public:
|
||||
return to24hr() + m_ + s_ + sub_s_;
|
||||
}
|
||||
|
||||
CONSTCD14 precision to_duration() const noexcept
|
||||
{
|
||||
return static_cast<precision>(*this);
|
||||
}
|
||||
|
||||
CONSTCD14 time_of_day_storage& make24() noexcept {base::make24(); return *this;}
|
||||
CONSTCD14 time_of_day_storage& make12() noexcept {base::make12(); return *this;}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user