RflySimSDK v4.10
RflySimSDK说明文档
载入中...
搜索中...
未找到
string_utils.hpp
1// __ _____ _____ _____
2// __| | __| | | | JSON for Modern C++
3// | | |__ | | | | | | version 3.12.0
4// |_____|_____|_____|_|___| https://github.com/nlohmann/json
5//
6// SPDX-FileCopyrightText: 2013-2025 Niels Lohmann <https://nlohmann.me>
7// SPDX-License-Identifier: MIT
8
9#pragma once
10
11#include <cstddef> // size_t
12#include <string> // string, to_string
13
14#include <nlohmann/detail/abi_macros.hpp>
15
16NLOHMANN_JSON_NAMESPACE_BEGIN
17namespace detail
18{
19
20template<typename StringType>
21void int_to_string(StringType& target, std::size_t value)
22{
23 // For ADL
24 using std::to_string;
25 target = to_string(value);
26}
27
28template<typename StringType>
29StringType to_string(std::size_t value)
30{
31 StringType result;
32 int_to_string(result, value);
33 return result;
34}
35
36} // namespace detail
37NLOHMANN_JSON_NAMESPACE_END
detail namespace with internal helper functions
定义 from_json.hpp:43