constexpr duration() = default;
(1) (since C++11)duration( const duration& ) = default;
(2) (since C++11)template< class Rep2 >
constexpr explicit duration( const Rep2& r );
template< class Rep2, class Period2 >
constexpr duration( const duration<Rep2, Period2>& d );
Constructs a new duration
from one of several optional data sources.
1) The default constructor.
2) The copy constructor.
3) Constructs a duration with r ticks.
4)Constructs a duration by converting
dto an appropriate period and tick count, as if by
std::chrono::duration_cast<duration>(d).count().
Period2
is exactly divisible by Period
.The following code shows several examples (both valid and invalid) of how to construct durations:
[edit] Defect reportsThe following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 2094 C++11 for overload (4), std::ratio_divide<Period2, period>::numRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4