Warning, /include/c++/v1/charconv is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP_CHARCONV
0011 #define _LIBCPP_CHARCONV
0012
0013 /*
0014 charconv synopsis
0015
0016 namespace std {
0017
0018 // floating-point format for primitive numerical conversion
0019 enum class chars_format {
0020 scientific = unspecified,
0021 fixed = unspecified,
0022 hex = unspecified,
0023 general = fixed | scientific
0024 };
0025
0026 // 23.20.2, primitive numerical output conversion
0027 struct to_chars_result {
0028 char* ptr;
0029 errc ec;
0030 friend bool operator==(const to_chars_result&, const to_chars_result&) = default; // since C++20
0031 constexpr explicit operator bool() const noexcept { return ec == errc{}; } // since C++26
0032 };
0033
0034 constexpr to_chars_result to_chars(char* first, char* last, see below value,
0035 int base = 10); // constexpr since C++23
0036 to_chars_result to_chars(char* first, char* last, bool value,
0037 int base = 10) = delete;
0038
0039 to_chars_result to_chars(char* first, char* last, float value);
0040 to_chars_result to_chars(char* first, char* last, double value);
0041 to_chars_result to_chars(char* first, char* last, long double value);
0042
0043 to_chars_result to_chars(char* first, char* last, float value,
0044 chars_format fmt);
0045 to_chars_result to_chars(char* first, char* last, double value,
0046 chars_format fmt);
0047 to_chars_result to_chars(char* first, char* last, long double value,
0048 chars_format fmt);
0049
0050 to_chars_result to_chars(char* first, char* last, float value,
0051 chars_format fmt, int precision);
0052 to_chars_result to_chars(char* first, char* last, double value,
0053 chars_format fmt, int precision);
0054 to_chars_result to_chars(char* first, char* last, long double value,
0055 chars_format fmt, int precision);
0056
0057 // 23.20.3, primitive numerical input conversion
0058 struct from_chars_result {
0059 const char* ptr;
0060 errc ec;
0061 friend bool operator==(const from_chars_result&, const from_chars_result&) = default; // since C++20
0062 constexpr explicit operator bool() const noexcept { return ec == errc{}; } // since C++26
0063 };
0064
0065 constexpr from_chars_result from_chars(const char* first, const char* last,
0066 see below& value, int base = 10); // constexpr since C++23
0067
0068 from_chars_result from_chars(const char* first, const char* last,
0069 float& value, chars_format fmt);
0070
0071 from_chars_result from_chars(const char* first, const char* last,
0072 double& value, chars_format fmt);
0073
0074 } // namespace std
0075
0076 */
0077
0078 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0079 # include <__cxx03/charconv>
0080 #else
0081 # include <__config>
0082
0083 # if _LIBCPP_STD_VER >= 17
0084 # include <__charconv/chars_format.h>
0085 # include <__charconv/from_chars_floating_point.h>
0086 # include <__charconv/from_chars_integral.h>
0087 # include <__charconv/from_chars_result.h>
0088 # include <__charconv/tables.h>
0089 # include <__charconv/to_chars.h>
0090 # include <__charconv/to_chars_base_10.h>
0091 # include <__charconv/to_chars_floating_point.h>
0092 # include <__charconv/to_chars_integral.h>
0093 # include <__charconv/to_chars_result.h>
0094 # include <__charconv/traits.h>
0095 # endif // _LIBCPP_STD_VER >= 17
0096
0097 # include <version>
0098
0099 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0100 # pragma GCC system_header
0101 # endif
0102
0103 _LIBCPP_BEGIN_NAMESPACE_STD
0104
0105 _LIBCPP_END_NAMESPACE_STD
0106
0107 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0108 # include <cmath>
0109 # include <concepts>
0110 # include <cstddef>
0111 # include <cstdint>
0112 # include <cstdlib>
0113 # include <cstring>
0114 # include <iosfwd>
0115 # include <limits>
0116 # include <new>
0117 # include <type_traits>
0118 # endif
0119 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0120
0121 #endif // _LIBCPP_CHARCONV