|
| template<typename T, typename P = package_t<T>, enable_if_t< is_packaged_v< T > &&is_base_of_v< istringify< P >, P >, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const T &value) |
| | 将可包装类型转换为字符串
|
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (nullptr_t np) |
| | 将空指针转换为字符串
|
| template<typename T, enable_if_t< is_pointer_v< T > &&!is_cstring_v< T >, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const T &ptr) |
| | 将指针转换为字符串
|
| template<typename T, enable_if_t< is_base_of_v< icollector< T >, T >, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const T &c) |
| | 将容器转换为字符串
|
| template<typename T, enable_if_t< is_unbounded_array_v< T >, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const T &) |
| | 将无界数组转换为字符串
|
| template<typename T, enable_if_t< is_bounded_array_v< T > &&!is_cstring_v< T >, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const T &arr) |
| | 将有界数组转换为字符串
|
| template<typename IfEmpty, typename T> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const compressed_pair< IfEmpty, T, true > &obj) |
| | 将压缩对(已压缩版本)转换为字符串
|
| template<typename IfEmpty, typename T> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const compressed_pair< IfEmpty, T, false > &obj) |
| | 将压缩对(未压缩版本)转换为字符串
|
| template<typename T1, typename T2> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const pair< T1, T2 > &obj) |
| | 将对转换为字符串
|
| template<typename... Args> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (const tuple< Args... > &tup) |
| | 将元组转换为字符串
|
| template<typename... Args, enable_if_t<(sizeof...(Args) > 1), int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string (Args &&... args) |
| | 将多个参数转换为字符串并连接
|
| template<typename T, enable_if_t< is_floating_point< T >::value, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string_with_precision (T x, int precision, bool scientific=false) |
| | 将浮点数转换为字符串(带精度控制)
|
| template<typename T, enable_if_t< is_floating_point< T >::value, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string_general (T x, int precision=6) |
| | 将浮点数转换为字符串(通用格式)
|
| template<typename T, enable_if_t< is_floating_point< T >::value, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string_fixed (T x, int precision=6) |
| | 将浮点数转换为字符串(固定小数格式)
|
| template<typename T, enable_if_t< is_floating_point< T >::value, int > = 0> |
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string_scientific (T x, int precision=6) |
| | 将浮点数转换为字符串(科学计数法格式)
|
类型到字符串的转换函数
此文件提供了将各种类型转换为字符串的通用函数。 支持基本类型、容器、元组、枚举、异常等多种类型的字符串表示。
在文件 to_string.hpp 中定义.