RFC: Include <charconv> in <utility> for C++17

Jonathan Wakely jwakely@redhat.com
Thu Jun 27 08:33:00 GMT 2019


I wonder if we want this patch:

--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -74,6 +74,9 @@
 #include <type_traits>
 #include <bits/move.h>
 #include <initializer_list>
+#if __cplusplus == 201703L && defined __STRICT_ANSI__
+# include <charconv>
+#endif

 namespace std _GLIBCXX_VISIBILITY(default)
 {

In the published C++17 standard, std::to_chars and std::from_chars are
meant to be in <utility>. The new <charconv> header was only
introduced post-C++17 by a defect report (specifically, by P0682R1).

But maybe this isn't needed, because there's no code in the wild that
was written before <charconv> was invented, so everybody should
already be using that.




More information about the Libstdc++ mailing list