From 65cf9572a479a937aa25737520e4eac8f9750f90 Mon Sep 17 00:00:00 2001 From: Jie Date: Tue, 7 Jan 2025 17:42:12 +0800 Subject: [PATCH] improve funtion round and add get_time_now function --- include/toolkit.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/toolkit.h b/include/toolkit.h index 04413ce..c34d417 100644 --- a/include/toolkit.h +++ b/include/toolkit.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace ranges = std::ranges; namespace views = std::ranges::views; @@ -99,7 +100,9 @@ namespace toolkit return std::vector(v.begin(), v.end()); } - double round(double value, int c){ + template + requires std::is_same_v || std::is_same_v + double round(T value, int c){ auto temp = 1; for(int i=0;i