This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C++17 P0067R5 std::to_chars and std::from_chars (partial)
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: Lars Gullik Bjønnes <lbjonnes at cisco dot com>
- Date: Tue, 3 Oct 2017 15:31:37 +0100
- Subject: Re: [PATCH] C++17 P0067R5 std::to_chars and std::from_chars (partial)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2845B7EAA3
- References: <20171002141317.GA12502@redhat.com>
On 02/10/17 15:13 +0100, Jonathan Wakely wrote:
+#ifndef _GLIBCXX_CHARCONV
+#define _GLIBCXX_CHARCONV 1
+
+#pragma GCC system_header
+
+#if __cplusplus >= 201402L
+
+#include <type_traits>
+#include <limits>
+#include <cctype>
+#include <bits/error_constants.h> // for std::errc
I forgot to mention that I've made this header work for C++14 not just C++17. I
did this for similar reasons as we make some C++17 things available for
-std=gnu++11 and -std=gnu++14:
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
But in this case <charconv> is a completely new header so we don't have to
limit it to -std=gnu++NN modes only. The new functions won't pollute namespace
std unless the new header gets included, which strictly-conforming C++14 code
won't do anyway.