Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-17 08:24:07

0001 // Copyright 2022 Peter Dimov
0002 // Copyright 2023 Matt Borland
0003 // Copyright 2023 Junekey Jeon
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // https://www.boost.org/LICENSE_1_0.txt
0006 
0007 #ifndef BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED
0008 #define BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED
0009 
0010 #include <boost/charconv/detail/to_chars_integer_impl.hpp>
0011 #include <boost/charconv/detail/to_chars_result.hpp>
0012 #include <boost/charconv/config.hpp>
0013 #include <boost/charconv/chars_format.hpp>
0014 
0015 namespace boost {
0016 namespace charconv {
0017 
0018 // integer overloads
0019 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, bool value, int base) noexcept = delete;
0020 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, char value, int base = 10) noexcept
0021 {
0022     return detail::to_chars_int(first, last, value, base);
0023 }
0024 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, signed char value, int base = 10) noexcept
0025 {
0026     return detail::to_chars_int(first, last, value, base);
0027 }
0028 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned char value, int base = 10) noexcept
0029 {
0030     return detail::to_chars_int(first, last, value, base);
0031 }
0032 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, short value, int base = 10) noexcept
0033 {
0034     return detail::to_chars_int(first, last, value, base);
0035 }
0036 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned short value, int base = 10) noexcept
0037 {
0038     return detail::to_chars_int(first, last, value, base);
0039 }
0040 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, int value, int base = 10) noexcept
0041 {
0042     return detail::to_chars_int(first, last, value, base);
0043 }
0044 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned int value, int base = 10) noexcept
0045 {
0046     return detail::to_chars_int(first, last, value, base);
0047 }
0048 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long value, int base = 10) noexcept
0049 {
0050     return detail::to_chars_int(first, last, value, base);
0051 }
0052 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long value, int base = 10) noexcept
0053 {
0054     return detail::to_chars_int(first, last, value, base);
0055 }
0056 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long long value, int base = 10) noexcept
0057 {
0058     return detail::to_chars_int(first, last, value, base);
0059 }
0060 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long long value, int base = 10) noexcept
0061 {
0062     return detail::to_chars_int(first, last, value, base);
0063 }
0064 
0065 #ifdef BOOST_CHARCONV_HAS_INT128
0066 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::int128_type value, int base = 10) noexcept
0067 {
0068     return detail::to_chars128(first, last, value, base);
0069 }
0070 BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::uint128_type value, int base = 10) noexcept
0071 {
0072     return detail::to_chars128(first, last, value, base);
0073 }
0074 #endif
0075 
0076 //----------------------------------------------------------------------------------------------------------------------
0077 // Floating Point
0078 //----------------------------------------------------------------------------------------------------------------------
0079 
0080 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value,
0081                                              chars_format fmt = chars_format::general) noexcept;
0082 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value,
0083                                              chars_format fmt = chars_format::general) noexcept;
0084 
0085 #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE
0086 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value,
0087                                              chars_format fmt = chars_format::general) noexcept;
0088 #endif
0089 
0090 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value,
0091                                              chars_format fmt, int precision) noexcept;
0092 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value, 
0093                                              chars_format fmt, int precision) noexcept;
0094 
0095 #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE
0096 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value,
0097                                              chars_format fmt, int precision) noexcept;
0098 #endif
0099 
0100 #ifdef BOOST_CHARCONV_HAS_QUADMATH
0101 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value,
0102                                              chars_format fmt = chars_format::general) noexcept;
0103 
0104 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value,
0105                                              chars_format fmt, int precision) noexcept;
0106 #endif
0107 
0108 #ifdef BOOST_CHARCONV_HAS_FLOAT16
0109 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value,
0110                                              chars_format fmt = chars_format::general) noexcept;
0111 
0112 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value, 
0113                                              chars_format fmt, int precision) noexcept;
0114 #endif
0115 #ifdef BOOST_CHARCONV_HAS_FLOAT32
0116 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value,
0117                                              chars_format fmt = chars_format::general) noexcept;
0118 
0119 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value, 
0120                                              chars_format fmt, int precision) noexcept;
0121 #endif
0122 #ifdef BOOST_CHARCONV_HAS_FLOAT64
0123 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value,
0124                                              chars_format fmt = chars_format::general) noexcept;
0125 
0126 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value, 
0127                                              chars_format fmt, int precision) noexcept;
0128 #endif
0129 #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH)
0130 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value,
0131                                              chars_format fmt = chars_format::general) noexcept;
0132 
0133 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value,
0134                                              chars_format fmt, int precision) noexcept;
0135 #endif
0136 #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16
0137 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value,
0138                                              chars_format fmt = chars_format::general) noexcept;
0139 
0140 BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value, 
0141                                              chars_format fmt, int precision) noexcept;
0142 #endif
0143 
0144 } // namespace charconv
0145 } // namespace boost
0146 
0147 #endif // #ifndef BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED