From 38386f0b5da86c6040deca34787c49a1d0e4134d Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Fri, 27 Feb 2026 16:17:34 +0100 Subject: [PATCH 1/3] Initial impl --- CMakeLists.txt | 11 +- include/boost/charconv/config.hpp | 14 +- include/boost/charconv/detail/apply_sign.hpp | 2 +- include/boost/charconv/detail/bit_layouts.hpp | 4 +- .../boost/charconv/detail/buffer_sizing.hpp | 2 +- .../boost/charconv/detail/compute_float32.hpp | 6 +- .../boost/charconv/detail/compute_float64.hpp | 8 +- .../boost/charconv/detail/compute_float80.hpp | 18 +-- include/boost/charconv/detail/config.hpp | 11 +- .../charconv/detail/dragonbox/dragonbox.hpp | 8 +- .../detail/dragonbox/dragonbox_common.hpp | 12 +- .../boost/charconv/detail/dragonbox/floff.hpp | 12 +- include/boost/charconv/detail/emulated128.hpp | 10 +- .../charconv/detail/fallback_routines.hpp | 12 +- .../detail/fast_float/ascii_number.hpp | 8 +- .../charconv/detail/fast_float/bigint.hpp | 8 +- .../fast_float/constexpr_feature_detect.hpp | 5 + .../detail/fast_float/decimal_to_binary.hpp | 12 +- .../detail/fast_float/digit_comparison.hpp | 8 +- .../charconv/detail/fast_float/fast_table.hpp | 2 +- .../detail/fast_float/float_common.hpp | 14 +- .../detail/fast_float/parse_number.hpp | 8 +- .../detail/from_chars_integer_impl.hpp | 14 +- .../charconv/detail/from_chars_result.hpp | 6 +- .../charconv/detail/integer_search_trees.hpp | 6 +- include/boost/charconv/detail/issignaling.hpp | 4 +- include/boost/charconv/detail/memcpy.hpp | 4 +- include/boost/charconv/detail/parser.hpp | 12 +- .../boost/charconv/detail/ryu/generic_128.hpp | 2 +- .../charconv/detail/ryu/ryu_generic_128.hpp | 8 +- .../charconv/detail/significand_tables.hpp | 2 +- .../charconv/detail/to_chars_integer_impl.hpp | 24 ++-- .../boost/charconv/detail/to_chars_result.hpp | 4 +- include/boost/charconv/detail/type_traits.hpp | 2 +- include/boost/charconv/from_chars.hpp | 130 +++++++++--------- include/boost/charconv/limits.hpp | 7 +- 36 files changed, 226 insertions(+), 194 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4525678d..49cb2b6b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.8...3.20) +cmake_minimum_required(VERSION 3.8...3.31) project(boost_charconv VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -14,6 +14,15 @@ add_library(boost_charconv add_library(Boost::charconv ALIAS boost_charconv) +if (BOOST_USE_MODULES) + target_sources(boost_charconv PUBLIC FILE_SET CXX_MODULES BASE_DIRS modules FILES modules/boost_charconv.cppm) + + # Enable and propagate C++23, import std, and the modules macro + target_compile_features(boost_charconv PUBLIC cxx_std_23) + set_target_properties(boost_charconv PROPERTIES CXX_MODULE_STD 1) + target_compile_definitions(boost_charconv PUBLIC BOOST_USE_MODULES) +endif() + target_include_directories(boost_charconv PUBLIC include) diff --git a/include/boost/charconv/config.hpp b/include/boost/charconv/config.hpp index 0d94ccd4a..a9d85b25e 100644 --- a/include/boost/charconv/config.hpp +++ b/include/boost/charconv/config.hpp @@ -1,3 +1,8 @@ +// Make the header safe to include from libraries supporting modules +#if defined(BOOST_IN_MODULE_PURVIEW) && !defined(BOOST_CHARCONV_CONFIG_HPP_INCLUDED) +# error "Please #include in your module global fragment" +#endif + #ifndef BOOST_CHARCONV_CONFIG_HPP_INCLUDED #define BOOST_CHARCONV_CONFIG_HPP_INCLUDED @@ -7,7 +12,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include -#include +#include // This header implements separate compilation features as described in // http://www.boost.org/more/separate_compilation.html @@ -36,4 +41,11 @@ #endif +// Modules +#ifdef BOOST_USE_MODULES +# define BOOST_CHARCONV_MODULE_EXPORT export +#else +# define BOOST_CHARCONV_MODULE_EXPORT +#endif + #endif // BOOST_CHARCONV_CONFIG_HPP_INCLUDED diff --git a/include/boost/charconv/detail/apply_sign.hpp b/include/boost/charconv/detail/apply_sign.hpp index ef6db7143..56c68cf56 100644 --- a/include/boost/charconv/detail/apply_sign.hpp +++ b/include/boost/charconv/detail/apply_sign.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include // We are purposefully converting values here #ifdef BOOST_MSVC diff --git a/include/boost/charconv/detail/bit_layouts.hpp b/include/boost/charconv/detail/bit_layouts.hpp index c163ce06a..4cf8ded5e 100644 --- a/include/boost/charconv/detail/bit_layouts.hpp +++ b/include/boost/charconv/detail/bit_layouts.hpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include // Layouts of floating point types as specified by IEEE 754 // See page 23 of IEEE 754-2008 diff --git a/include/boost/charconv/detail/buffer_sizing.hpp b/include/boost/charconv/detail/buffer_sizing.hpp index 3115ee39e..b7b6957b2 100644 --- a/include/boost/charconv/detail/buffer_sizing.hpp +++ b/include/boost/charconv/detail/buffer_sizing.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace boost { namespace charconv { diff --git a/include/boost/charconv/detail/compute_float32.hpp b/include/boost/charconv/detail/compute_float32.hpp index 85ece7f8c..287c9515f 100644 --- a/include/boost/charconv/detail/compute_float32.hpp +++ b/include/boost/charconv/detail/compute_float32.hpp @@ -6,9 +6,9 @@ #define BOOST_CHARCONV_DETAIL_COMPUTE_FLOAT32_HPP #include -#include -#include -#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/compute_float64.hpp b/include/boost/charconv/detail/compute_float64.hpp index 3cb83537f..0958f05ee 100644 --- a/include/boost/charconv/detail/compute_float64.hpp +++ b/include/boost/charconv/detail/compute_float64.hpp @@ -10,10 +10,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/compute_float80.hpp b/include/boost/charconv/detail/compute_float80.hpp index ad1e51486..892b83656 100644 --- a/include/boost/charconv/detail/compute_float80.hpp +++ b/include/boost/charconv/detail/compute_float80.hpp @@ -8,17 +8,17 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #ifdef BOOST_CHARCONV_DEBUG_FLOAT128 -#include -#include +#include +#include #include #endif diff --git a/include/boost/charconv/detail/config.hpp b/include/boost/charconv/detail/config.hpp index 9feb609fe..8ad4dba7b 100644 --- a/include/boost/charconv/detail/config.hpp +++ b/include/boost/charconv/detail/config.hpp @@ -2,12 +2,17 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +// Make this header safe to include in our purview +#if defined(BOOST_IN_MODULE_PURVIEW) && !defined(BOOST_CHARCONV_DETAIL_CONFIG_HPP) +# error "Please #include in your module global fragment" +#endif + #ifndef BOOST_CHARCONV_DETAIL_CONFIG_HPP #define BOOST_CHARCONV_DETAIL_CONFIG_HPP #include -#include -#include +#include +#include #include #define BOOST_CHARCONV_ASSERT(expr) BOOST_ASSERT(expr) @@ -169,7 +174,7 @@ static_assert((BOOST_CHARCONV_ENDIAN_BIG_BYTE || BOOST_CHARCONV_ENDIAN_LITTLE_BY // All of these types are optional so check for each of them individually #if (defined(_MSVC_LANG) && _MSVC_LANG > 202002L) || __cplusplus > 202002L # if __has_include() -# include +# include # endif #endif #ifdef __STDCPP_FLOAT16_T__ diff --git a/include/boost/charconv/detail/dragonbox/dragonbox.hpp b/include/boost/charconv/detail/dragonbox/dragonbox.hpp index f2d3449ac..abbff3f52 100644 --- a/include/boost/charconv/detail/dragonbox/dragonbox.hpp +++ b/include/boost/charconv/detail/dragonbox/dragonbox.hpp @@ -30,10 +30,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #ifdef BOOST_MSVC # pragma warning(push) diff --git a/include/boost/charconv/detail/dragonbox/dragonbox_common.hpp b/include/boost/charconv/detail/dragonbox/dragonbox_common.hpp index 0bee7d091..0fb86943e 100644 --- a/include/boost/charconv/detail/dragonbox/dragonbox_common.hpp +++ b/include/boost/charconv/detail/dragonbox/dragonbox_common.hpp @@ -29,12 +29,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/dragonbox/floff.hpp b/include/boost/charconv/detail/dragonbox/floff.hpp index 8eaaffd80..698712f0c 100644 --- a/include/boost/charconv/detail/dragonbox/floff.hpp +++ b/include/boost/charconv/detail/dragonbox/floff.hpp @@ -31,12 +31,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #ifdef BOOST_MSVC # pragma warning(push) diff --git a/include/boost/charconv/detail/emulated128.hpp b/include/boost/charconv/detail/emulated128.hpp index 281b031cb..6fabda2cb 100644 --- a/include/boost/charconv/detail/emulated128.hpp +++ b/include/boost/charconv/detail/emulated128.hpp @@ -11,11 +11,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/fallback_routines.hpp b/include/boost/charconv/detail/fallback_routines.hpp index 94f87b82b..db34a3db2 100644 --- a/include/boost/charconv/detail/fallback_routines.hpp +++ b/include/boost/charconv/detail/fallback_routines.hpp @@ -10,12 +10,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { diff --git a/include/boost/charconv/detail/fast_float/ascii_number.hpp b/include/boost/charconv/detail/fast_float/ascii_number.hpp index 159a7661d..bd5bd4a19 100644 --- a/include/boost/charconv/detail/fast_float/ascii_number.hpp +++ b/include/boost/charconv/detail/fast_float/ascii_number.hpp @@ -9,10 +9,10 @@ #define BOOST_CHARCONV_DETAIL_FASTFLOAT_ASCII_NUMBER_HPP #include -#include -#include -#include -#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/fast_float/bigint.hpp b/include/boost/charconv/detail/fast_float/bigint.hpp index fd98590cd..c3dbf9e71 100644 --- a/include/boost/charconv/detail/fast_float/bigint.hpp +++ b/include/boost/charconv/detail/fast_float/bigint.hpp @@ -9,10 +9,10 @@ #define BOOST_CHARCONV_DETAIL_FASTFLOAT_BIGINT_HPP #include -#include -#include -#include -#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/fast_float/constexpr_feature_detect.hpp b/include/boost/charconv/detail/fast_float/constexpr_feature_detect.hpp index 1ac1e4aab..2a5eb4843 100644 --- a/include/boost/charconv/detail/fast_float/constexpr_feature_detect.hpp +++ b/include/boost/charconv/detail/fast_float/constexpr_feature_detect.hpp @@ -5,6 +5,11 @@ // // Derivative of: https://github.com/fastfloat/fast_float +// Make the header safe to include from libraries supporting modules +#if defined(BOOST_IN_MODULE_PURVIEW) && !defined(BOOST_CHARCONV_DETAIL_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_HPP) +# error "Please #include in your module global fragment" +#endif + #ifndef BOOST_CHARCONV_DETAIL_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_HPP #define BOOST_CHARCONV_DETAIL_FASTFLOAT_CONSTEXPR_FEATURE_DETECT_HPP diff --git a/include/boost/charconv/detail/fast_float/decimal_to_binary.hpp b/include/boost/charconv/detail/fast_float/decimal_to_binary.hpp index 4a76a6eeb..5a107d2a0 100644 --- a/include/boost/charconv/detail/fast_float/decimal_to_binary.hpp +++ b/include/boost/charconv/detail/fast_float/decimal_to_binary.hpp @@ -10,12 +10,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/fast_float/digit_comparison.hpp b/include/boost/charconv/detail/fast_float/digit_comparison.hpp index 231279410..0c5fc7799 100644 --- a/include/boost/charconv/detail/fast_float/digit_comparison.hpp +++ b/include/boost/charconv/detail/fast_float/digit_comparison.hpp @@ -11,10 +11,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/fast_float/fast_table.hpp b/include/boost/charconv/detail/fast_float/fast_table.hpp index e08eb3145..ce9b13adf 100644 --- a/include/boost/charconv/detail/fast_float/fast_table.hpp +++ b/include/boost/charconv/detail/fast_float/fast_table.hpp @@ -9,7 +9,7 @@ #define BOOST_CHARCONV_DETAIL_FASTFLOAT_FAST_TABLE_HPP #include -#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/fast_float/float_common.hpp b/include/boost/charconv/detail/fast_float/float_common.hpp index 0b9d3aee5..e6e320d4b 100644 --- a/include/boost/charconv/detail/fast_float/float_common.hpp +++ b/include/boost/charconv/detail/fast_float/float_common.hpp @@ -12,12 +12,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { @@ -38,7 +38,7 @@ using parse_options = parse_options_t; }}}} #if BOOST_CHARCONV_FASTFLOAT_HAS_BIT_CAST -#include +#include #endif #if (defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \ diff --git a/include/boost/charconv/detail/fast_float/parse_number.hpp b/include/boost/charconv/detail/fast_float/parse_number.hpp index 9f71d45c2..e76b4a846 100644 --- a/include/boost/charconv/detail/fast_float/parse_number.hpp +++ b/include/boost/charconv/detail/fast_float/parse_number.hpp @@ -13,10 +13,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { namespace fast_float { diff --git a/include/boost/charconv/detail/from_chars_integer_impl.hpp b/include/boost/charconv/detail/from_chars_integer_impl.hpp index 69d5e5f95..3171265af 100644 --- a/include/boost/charconv/detail/from_chars_integer_impl.hpp +++ b/include/boost/charconv/detail/from_chars_integer_impl.hpp @@ -12,13 +12,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/from_chars_result.hpp b/include/boost/charconv/detail/from_chars_result.hpp index e4302cfab..d257945dd 100644 --- a/include/boost/charconv/detail/from_chars_result.hpp +++ b/include/boost/charconv/detail/from_chars_result.hpp @@ -5,13 +5,13 @@ #ifndef BOOST_CHARCONV_DETAIL_FROM_CHARS_RESULT_HPP #define BOOST_CHARCONV_DETAIL_FROM_CHARS_RESULT_HPP -#include +#include namespace boost { namespace charconv { // 22.13.3, Primitive numerical input conversion -template +BOOST_CHARCONV_MODULE_EXPORT template struct from_chars_result_t { const UC* ptr; @@ -34,7 +34,7 @@ struct from_chars_result_t constexpr explicit operator bool() const noexcept { return ec == std::errc{}; } }; -using from_chars_result = from_chars_result_t; +BOOST_CHARCONV_MODULE_EXPORT using from_chars_result = from_chars_result_t; }} // Namespaces diff --git a/include/boost/charconv/detail/integer_search_trees.hpp b/include/boost/charconv/detail/integer_search_trees.hpp index 52e8ec12d..d2c47da99 100644 --- a/include/boost/charconv/detail/integer_search_trees.hpp +++ b/include/boost/charconv/detail/integer_search_trees.hpp @@ -10,9 +10,9 @@ #include #include -#include -#include -#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/issignaling.hpp b/include/boost/charconv/detail/issignaling.hpp index 0780c2e89..0c5efe641 100644 --- a/include/boost/charconv/detail/issignaling.hpp +++ b/include/boost/charconv/detail/issignaling.hpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/memcpy.hpp b/include/boost/charconv/detail/memcpy.hpp index 1e68315f4..a614b2dc4 100644 --- a/include/boost/charconv/detail/memcpy.hpp +++ b/include/boost/charconv/detail/memcpy.hpp @@ -6,8 +6,8 @@ #define BOOST_CHARCONV_DETAIL_MEMCPY_HPP #include -#include -#include +#include +#include // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89689 // GCC 10 added checks for length of memcpy which yields the following warning (converted to error with -Werror) diff --git a/include/boost/charconv/detail/parser.hpp b/include/boost/charconv/detail/parser.hpp index 660de6884..c851a62d2 100644 --- a/include/boost/charconv/detail/parser.hpp +++ b/include/boost/charconv/detail/parser.hpp @@ -11,12 +11,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) # pragma GCC diagnostic push diff --git a/include/boost/charconv/detail/ryu/generic_128.hpp b/include/boost/charconv/detail/ryu/generic_128.hpp index 23c5234dd..748d8b129 100644 --- a/include/boost/charconv/detail/ryu/generic_128.hpp +++ b/include/boost/charconv/detail/ryu/generic_128.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #define BOOST_CHARCONV_POW5_TABLE_SIZE 56 #define BOOST_CHARCONV_POW5_BITCOUNT 249 diff --git a/include/boost/charconv/detail/ryu/ryu_generic_128.hpp b/include/boost/charconv/detail/ryu/ryu_generic_128.hpp index 2047d9a70..38b440496 100644 --- a/include/boost/charconv/detail/ryu/ryu_generic_128.hpp +++ b/include/boost/charconv/detail/ryu/ryu_generic_128.hpp @@ -11,12 +11,12 @@ #include #include #include -#include -#include -#include +#include +#include +#include #ifdef BOOST_CHARCONV_DEBUG -# include +# include #endif namespace boost { namespace charconv { namespace detail { namespace ryu { diff --git a/include/boost/charconv/detail/significand_tables.hpp b/include/boost/charconv/detail/significand_tables.hpp index 51dd71f45..b55d4cb2c 100644 --- a/include/boost/charconv/detail/significand_tables.hpp +++ b/include/boost/charconv/detail/significand_tables.hpp @@ -7,7 +7,7 @@ #define BOOST_CHARCONV_DETAIL_SIGNIFICAND_TABLES_HPP #include -#include +#include // The significand of a floating point number is often referred to as the mantissa. // Using the term mantissa is discouraged by IEEE 1516 diff --git a/include/boost/charconv/detail/to_chars_integer_impl.hpp b/include/boost/charconv/detail/to_chars_integer_impl.hpp index 5b256c26f..dc69bb1ab 100644 --- a/include/boost/charconv/detail/to_chars_integer_impl.hpp +++ b/include/boost/charconv/detail/to_chars_integer_impl.hpp @@ -13,18 +13,18 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/detail/to_chars_result.hpp b/include/boost/charconv/detail/to_chars_result.hpp index e564fe6cd..85f92be87 100644 --- a/include/boost/charconv/detail/to_chars_result.hpp +++ b/include/boost/charconv/detail/to_chars_result.hpp @@ -5,13 +5,13 @@ #ifndef BOOST_CHARCONV_DETAIL_TO_CHARS_RESULT_HPP #define BOOST_CHARCONV_DETAIL_TO_CHARS_RESULT_HPP -#include +#include // 22.13.2, Primitive numerical output conversion namespace boost { namespace charconv { -struct to_chars_result +BOOST_CHARCONV_MODULE_EXPORT struct to_chars_result { char *ptr; std::errc ec; diff --git a/include/boost/charconv/detail/type_traits.hpp b/include/boost/charconv/detail/type_traits.hpp index 416055516..3400d845e 100644 --- a/include/boost/charconv/detail/type_traits.hpp +++ b/include/boost/charconv/detail/type_traits.hpp @@ -6,7 +6,7 @@ #define BOOST_CHARCONV_DETAIL_TYPE_TRAITS_HPP #include -#include +#include namespace boost { namespace charconv { namespace detail { diff --git a/include/boost/charconv/from_chars.hpp b/include/boost/charconv/from_chars.hpp index 0bef0b5f5..d647694dc 100644 --- a/include/boost/charconv/from_chars.hpp +++ b/include/boost/charconv/from_chars.hpp @@ -13,121 +13,121 @@ #include #include #include -#include +#include namespace boost { namespace charconv { // integer overloads -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, bool& value, int base = 10) noexcept = delete; -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, bool& value, int base = 10) noexcept = delete; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, char& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, signed char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, signed char& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned char& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, short& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, short& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned short& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned short& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, int& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, int& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned int& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned int& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, long& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned long& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, long long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, long long& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned long long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, unsigned long long& value, int base = 10) noexcept { return detail::from_chars(first, last, value, base); } #ifdef BOOST_CHARCONV_HAS_INT128 -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, boost::int128_type& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, boost::int128_type& value, int base = 10) noexcept { return detail::from_chars128(first, last, value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, boost::uint128_type& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(const char* first, const char* last, boost::uint128_type& value, int base = 10) noexcept { return detail::from_chars128(first, last, value, base); } #endif -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, bool& value, int base = 10) noexcept = delete; -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, bool& value, int base = 10) noexcept = delete; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, char& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, signed char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, signed char& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned char& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned char& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, short& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, short& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned short& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned short& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, int& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, int& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned int& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned int& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, long& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned long& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, long long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, long long& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned long long& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, unsigned long long& value, int base = 10) noexcept { return detail::from_chars(sv.data(), sv.data() + sv.size(), value, base); } #ifdef BOOST_CHARCONV_HAS_INT128 -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, boost::int128_type& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, boost::int128_type& value, int base = 10) noexcept { return detail::from_chars128(sv.data(), sv.data() + sv.size(), value, base); } -BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, boost::uint128_type& value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_view sv, boost::uint128_type& value, int base = 10) noexcept { return detail::from_chars128(sv.data(), sv.data() + sv.size(), value, base); } @@ -137,116 +137,116 @@ BOOST_CHARCONV_GCC5_CONSTEXPR from_chars_result from_chars(boost::core::string_v // Floating Point //---------------------------------------------------------------------------------------------------------------------- -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_QUADMATH -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; #endif // types #ifdef BOOST_CHARCONV_HAS_FLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT32 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT64 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; #endif #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH) -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(const char* first, const char* last, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; #endif -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_QUADMATH -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; #endif // types #ifdef BOOST_CHARCONV_HAS_FLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT32 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT64 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; #endif #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH) -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars_erange(boost::core::string_view sv, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; #endif // The following adhere to the standard library definition with std::errc::result_out_of_range // Returns value unmodified // See: https://github.com/cppalliance/charconv/issues/110 -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, float& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, double& value, chars_format fmt = chars_format::general) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_QUADMATH -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, __float128& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT32 -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT64 -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; #endif #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH) -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(const char* first, const char* last, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; #endif -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, float& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, double& value, chars_format fmt = chars_format::general) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, long double& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_QUADMATH -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, __float128& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float16_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT32 -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float32_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT64 -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float64_t& value, chars_format fmt = chars_format::general) noexcept; #endif #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH) -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::float128_t& value, chars_format fmt = chars_format::general) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16 -BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(boost::core::string_view sv, std::bfloat16_t& value, chars_format fmt = chars_format::general) noexcept; #endif } // namespace charconv diff --git a/include/boost/charconv/limits.hpp b/include/boost/charconv/limits.hpp index f62809f30..07df42208 100644 --- a/include/boost/charconv/limits.hpp +++ b/include/boost/charconv/limits.hpp @@ -6,8 +6,9 @@ #define BOOST_CHARCONV_LIMITS_HPP #include -#include -#include +#include +#include +#include namespace boost { namespace charconv { @@ -41,7 +42,7 @@ template struct is_uint128: std::false_type {}; } // namespace detail -template struct limits +BOOST_CHARCONV_MODULE_EXPORT template struct limits { BOOST_ATTRIBUTE_UNUSED static constexpr int max_chars10 = From 1cab8239d10183708bf62ad017da5700605f8ebd Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Fri, 27 Feb 2026 16:26:30 +0100 Subject: [PATCH 2/3] Remaining headers --- include/boost/charconv/chars_format.hpp | 4 +- include/boost/charconv/to_chars.hpp | 64 ++++++++++++------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/include/boost/charconv/chars_format.hpp b/include/boost/charconv/chars_format.hpp index 0542372bf..2fa5c87ce 100644 --- a/include/boost/charconv/chars_format.hpp +++ b/include/boost/charconv/chars_format.hpp @@ -5,11 +5,13 @@ #ifndef BOOST_CHARCONV_CHARS_FORMAT_HPP #define BOOST_CHARCONV_CHARS_FORMAT_HPP +#include + namespace boost { namespace charconv { // Floating-point format for primitive numerical conversion // chars_format is a bitmask type (16.3.3.3.3) -enum class chars_format : unsigned +BOOST_CHARCONV_MODULE_EXPORT enum class chars_format : unsigned { scientific = 1 << 0, fixed = 1 << 1, diff --git a/include/boost/charconv/to_chars.hpp b/include/boost/charconv/to_chars.hpp index 7192fda57..207696a52 100644 --- a/include/boost/charconv/to_chars.hpp +++ b/include/boost/charconv/to_chars.hpp @@ -16,58 +16,58 @@ namespace boost { namespace charconv { // integer overloads -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, bool value, int base) noexcept = delete; -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, char value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, bool value, int base) noexcept = delete; +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, char value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, signed char value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, signed char value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned char value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned char value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, short value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, short value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned short value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned short value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, int value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, int value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned int value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned int value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long long value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, long long value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long long value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, unsigned long long value, int base = 10) noexcept { return detail::to_chars_int(first, last, value, base); } #ifdef BOOST_CHARCONV_HAS_INT128 -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::int128_type value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::int128_type value, int base = 10) noexcept { return detail::to_chars128(first, last, value, base); } -BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::uint128_type value, int base = 10) noexcept +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost::uint128_type value, int base = 10) noexcept { return detail::to_chars128(first, last, value, base); } @@ -77,67 +77,67 @@ BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars(char* first, char* last, boost // Floating Point //---------------------------------------------------------------------------------------------------------------------- -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value, chars_format fmt = chars_format::general) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value, chars_format fmt = chars_format::general) noexcept; #endif -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, float value, chars_format fmt, int precision) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, double value, chars_format fmt, int precision) noexcept; #ifndef BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, long double value, chars_format fmt, int precision) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_QUADMATH -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, __float128 value, chars_format fmt, int precision) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT16 -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float16_t value, chars_format fmt, int precision) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT32 -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float32_t value, chars_format fmt, int precision) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_FLOAT64 -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float64_t value, chars_format fmt, int precision) noexcept; #endif #if defined(BOOST_CHARCONV_HAS_STDFLOAT128) && defined(BOOST_CHARCONV_HAS_QUADMATH) -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::float128_t value, chars_format fmt, int precision) noexcept; #endif #ifdef BOOST_CHARCONV_HAS_BRAINFLOAT16 -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value, chars_format fmt = chars_format::general) noexcept; -BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value, +BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* first, char* last, std::bfloat16_t value, chars_format fmt, int precision) noexcept; #endif From ae1ef028bba9eb498711846a9bf9ea1d930dffbe Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Fri, 27 Feb 2026 16:30:36 +0100 Subject: [PATCH 3/3] compat headers --- include/boost/charconv/chars_format.hpp | 13 +++++++++++++ include/boost/charconv/from_chars.hpp | 13 +++++++++++++ include/boost/charconv/limits.hpp | 13 +++++++++++++ include/boost/charconv/to_chars.hpp | 13 +++++++++++++ 4 files changed, 52 insertions(+) diff --git a/include/boost/charconv/chars_format.hpp b/include/boost/charconv/chars_format.hpp index 2fa5c87ce..2eb4d503a 100644 --- a/include/boost/charconv/chars_format.hpp +++ b/include/boost/charconv/chars_format.hpp @@ -5,6 +5,17 @@ #ifndef BOOST_CHARCONV_CHARS_FORMAT_HPP #define BOOST_CHARCONV_CHARS_FORMAT_HPP +#if defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.charconv; +#ifndef BOOST_CHARCONV_CONSTEXPR +#define BOOST_CHARCONV_CONSTEXPR constexpr +#endif +#endif + +#else + #include namespace boost { namespace charconv { @@ -21,4 +32,6 @@ BOOST_CHARCONV_MODULE_EXPORT enum class chars_format : unsigned }} // Namespaces +#endif // defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + #endif // BOOST_CHARCONV_CHARS_FORMAT_HPP diff --git a/include/boost/charconv/from_chars.hpp b/include/boost/charconv/from_chars.hpp index d647694dc..d59faa6b2 100644 --- a/include/boost/charconv/from_chars.hpp +++ b/include/boost/charconv/from_chars.hpp @@ -6,6 +6,17 @@ #ifndef BOOST_CHARCONV_FROM_CHARS_HPP_INCLUDED #define BOOST_CHARCONV_FROM_CHARS_HPP_INCLUDED +#if defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.charconv; +#ifndef BOOST_CHARCONV_CONSTEXPR +#define BOOST_CHARCONV_CONSTEXPR constexpr +#endif +#endif + +#else + #include #include #include @@ -252,4 +263,6 @@ BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL from_chars_result from_chars(bo } // namespace charconv } // namespace boost +#endif // defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + #endif // #ifndef BOOST_CHARCONV_FROM_CHARS_HPP_INCLUDED diff --git a/include/boost/charconv/limits.hpp b/include/boost/charconv/limits.hpp index 07df42208..4568b23a8 100644 --- a/include/boost/charconv/limits.hpp +++ b/include/boost/charconv/limits.hpp @@ -5,6 +5,17 @@ #ifndef BOOST_CHARCONV_LIMITS_HPP #define BOOST_CHARCONV_LIMITS_HPP +#if defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.charconv; +#ifndef BOOST_CHARCONV_CONSTEXPR +#define BOOST_CHARCONV_CONSTEXPR constexpr +#endif +#endif + +#else + #include #include #include @@ -94,4 +105,6 @@ template BOOST_ATTRIBUTE_UNUSED constexpr int limits::max_chars; }} // namespace boost::charconv +#endif // defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + #endif // BOOST_CHARCONV_LIMITS_HPP diff --git a/include/boost/charconv/to_chars.hpp b/include/boost/charconv/to_chars.hpp index 207696a52..7e6cd0f23 100644 --- a/include/boost/charconv/to_chars.hpp +++ b/include/boost/charconv/to_chars.hpp @@ -7,6 +7,17 @@ #ifndef BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED #define BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED +#if defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.charconv; +#ifndef BOOST_CHARCONV_CONSTEXPR +#define BOOST_CHARCONV_CONSTEXPR constexpr +#endif +#endif + +#else + #include #include #include @@ -144,4 +155,6 @@ BOOST_CHARCONV_MODULE_EXPORT BOOST_CHARCONV_DECL to_chars_result to_chars(char* } // namespace charconv } // namespace boost +#endif // defined(BOOST_USE_MODULES) && !defined(BOOST_CHARCONV_INTERFACE_UNIT) + #endif // #ifndef BOOST_CHARCONV_TO_CHARS_HPP_INCLUDED