This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Documentation about C++ Concepts


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!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]