std::string_view 的使用

This commit is contained in:
2026-06-29 09:40:55 +08:00
parent cd446b7ca8
commit 8daf67aa5d
52 changed files with 1420 additions and 1367 deletions
+2 -1
View File
@@ -11,6 +11,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <string_view>
using Func_Type = void (*)(MLAT_Data *buf, std::uint16_t *len);
Func_Type read_func_ptr{};
@@ -28,7 +29,7 @@ double lat = 121.473701;
//
// *len = 1;
// }
time_t datetime_to_timestamp(const std::string &datetime) {
time_t datetime_to_timestamp(std::string_view datetime) {
std::tm tm = {};
std::istringstream ss(datetime);
ss >> std::get_time(&tm, "%Y-%m-%d %H:%M:%S");