RFC: What should go in our <version> header?
Jonathan Wakely
jwakely@redhat.com
Mon Jun 18 16:42:00 GMT 2018
On 18/06/18 15:12 +0300, Ville Voutilainen wrote:
>On 17 June 2018 at 19:49, Ed Smith-Rowland <3dw4rd@verizon.net> wrote:
>> On 06/15/2018 11:52 AM, Jonathan Wakely wrote:
>>>
>>> C++20 adds a <version> header, which should define all the library
>>> feature test macros, as well as implementation-specific macros like
>>> _GLIBCXX_RELEASE and __GLIBCXX__.
>>>
>>> We should decide whether to implement <version> by simply including
>>> <bits/c++config.h> and then adding the feature test macros, or if we
>>> should keep it minimal and *only* define _GLIBCXX_RELEASE and
>>> __GLIBCXX__ and the feature tests (and then have <bits/c++config.h>
>>> include <version>?)
>>>
>>> I think I prefer to make <version> just include <bits/c++config.h>.
>>>
>>> I think we should define the feature-test macros in both <version> and
>>> the relevant header (e.g. __cpp_string_view in <string_view>). We
>>> could make everything include <version> and then every header would
>>> define every feature test macro, but I don't think that's good for
>>> portability.
>>>
>>> My preference is implemented by the attached patch.
>>>
>> This is pretty much what I was looking at doing. I say go!
>
>+1 looks reasonable to me.
Here's what I've committed, which adds tests and also defines
__STDCPP_MATH_SPEC_FUNCS__ in <version>.
I've also added this and the new C++17 headers to the <bits/stdc++.h>
precompiled header.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 33706 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20180618/8a185ad6/attachment.bin>
More information about the Libstdc++
mailing list