Skip to content

Commit 4920fe6

Browse files
committed
update the chrono C++20 support
1 parent fc55d14 commit 4920fe6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

target_data/Cpp/cppDesktop/include/unit_system_20.hpp.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ namespace std{
249249
//add compatibility with std::chrono
250250
namespace sakurajin{
251251
namespace unit_system{
252-
template<class Rep, class Period = std::ratio<1> >
253-
time_si unit_cast(const std::chrono::duration<Rep, Period>& other, auto new_multiplier = 1.0){
252+
template<class Rep, class Period = std::ratio<1>, class mult_t = UNIT_SYSTEM_DEFAULT_TYPE>
253+
requires std::convertible_to<mult_t, UNIT_SYSTEM_DEFAULT_TYPE>
254+
time_si unit_cast(const std::chrono::duration<Rep, Period>& other, mult_t new_multiplier = 1.0){
254255
auto t = std::chrono::duration_cast<std::chrono::duration<double, std::ratio<1,1>>>(other);
255256
auto retval = time_si{t.count(), 1};
256257
return retval.convert_multiplier(new_multiplier);

0 commit comments

Comments
 (0)