This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Documentation about C++ Concepts
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Akim Demaille <akim dot demaille at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 21 Dec 2015 00:55:29 +0000
- Subject: Re: Documentation about C++ Concepts
- Authentication-results: sourceware.org; auth=none
- References: <65DEE252-A79D-49AA-BE57-1229A2076176 at gmail dot com>
On 20 December 2015 at 19:13, Akim Demaille <akim.demaille@gmail.com> wrote:
> Hi!
>
> Iâm looking for a #if guard to enable/disable code using concepts-lite.
As required by the Concepts TS, the compiler defines __cpp_concepts
when it supports concepts.
> The compiler version does not suffice, as it depends on -std=c++1z.
For GCC you could test __cplusplus to see if -std=c++1z was used,
because Concepts support is always enabled when __cplusplus > 201402L.
> Also, the documentation about concepts seems to be about the previous attempts at concepts.
>
> https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Concepts.html#C_002b_002b-Concepts
>
> And actually, I did not find the documentation for c++1z, nor even -std=c++14.
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
Also
https://gcc.gnu.org/projects/cxx1y.html
https://gcc.gnu.org/projects/cxx1z.html
> https://gcc.gnu.org/onlinedocs/gcc/Standards.html#index-std-60
>
> Finally, one would expect to see documentation about -std in "Options Controlling C++ Dialect", since the corresponding about C documents -std for C.
>
> https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options
That's the documentation about -std in general, not -std for C. It
says "The following options control the dialect of C (or languages
derived from C, such as C++, ...)"
> Thanks!