-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
Dev Tools 2019-06-03
While duration's basic constructor is constexpr (as is it's default) allowing for:
constexpr Seconds foo(20);
It's implicit converting construct is not. Disallowing:
constexpr Milliseconds foo = Seconds(20);
This reduces the readability of Duration's (compared to standard durations) when constexpr semantics are required.
I think that in the past we avoided this because it requires a constexpr duration_cast, which is painful to write in C++11. Extended constexpr in C++14 should simplify things though, so I'd like to revisit as part of the C++14 codebase epic.