mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-15 19:32:56 +00:00
![]() This makes attribute_value and lexical_cast use the "new" to/from_chars api. Its main advantages are: - It's guaranteed to be locale independent, hopefully fixing all cases of #3945 and similar - It fixes some cases config serialization, in particular the test ``` cfg["x"] = "9.87654321"; BOOST_CHECK_EQUAL(cfg["x"], 9.87654321); ``` - Previously the lexical_cast implementation used exception handling for invalid formats (catching std::invalid_argument) which made noise during debugging (and is also slower if it is not optimized out). - It's faster So far afaik the only compiler which has a complete and proper to/from_chars implementation is msvc, gccs implementation of from_chars sometimes uses strtod under the hood and clang simply hasn't implemented from_chars for floating point numbers yet at all (actually the upcomig clang 20 will have it). Luckily for us, there is now also boost::charconv that can be used. So this raises to minimum build requirement to have at least one of: - msvc 2019 update 5 - gcc 11 - clang 14 (i have added a fallback implementation of from_chars for this case, that doesn't support all of its features, and is probably certainly not as fast as the boost version, but supports the features that we use from it) - boost 1.85 Since in particular the gcc implementation isn't that good (at least it on gcc11), boost charconv is the preferred implementation that is used if available. This also removes a strange overload for pointers to integers in lexical_cast while changing lexical_cast to use the new api. |
||
---|---|---|
.. | ||
boost.py | ||
cairo.py | ||
ccache.py | ||
config_check_utils.py | ||
cplusplus.py | ||
cross_compile.py | ||
distcc.py | ||
gettext_tool.py | ||
install.py | ||
lua.py | ||
metasconf.py | ||
pango.py | ||
pkgconfig.py | ||
scanreplace.py | ||
sdl.py | ||
system_include.py |