Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I build gcc with C++ concepts ("concepts lite") support?

The C++ standards committee is working on a TS (Technical Specification) for Concepts extension: "Programming Languages - C++ Extensions for Concepts". N4377 is the latest version of this document. For inclusion into the C++ standard features are asked to be implemented, ideally for a publicly accessible system.

I'm aware of concept-gcc but the concepts proposal above (colloquially referred to as Concepts Lite) is different. I heard that there is a concepts branch and I have tried the origin/asutton/c++-concepts from gcc's git mirror but that didn't compile. How do I build and use a version of gcc supporting concepts as specified in the above [draft] TS?

like image 760
Dietmar Kühl Avatar asked May 17 '15 18:05

Dietmar Kühl


People also ask

Does GCC 11 support C ++ 17?

C++17 features are available since GCC 5. This mode is the default in GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well.

Is GCC AC or C++ compiler?

gcc is the GNU C Compiler and g++ is the GNU C++ compiler. Below are several examples that show how to use g++ to compile C++ programs.

What is the difference between C++ and GCC?

Difference between gcc and g++ gcc is used to compile C program while g++ is used to compile C++ program. Since, a C program can also be compile complied through g++, because it is the extended or we can say advance compiler for C programming language.


1 Answers

As of Fri, 7 Aug 2015 01:44:49 -0400 (05:44 +0000) concepts support has been merged into gcc's trunk.

Using a build from after that point, you can enable concepts support with the -std=c++1z flag.

As of gcc 6.1 (27-04-2016), concepts are enabled by -fconcepts as they are unlikely to be included in C++17, so they have been removed from -std=c++1z. (via @BruceAdams in comments below)

like image 175
Yakk - Adam Nevraumont Avatar answered Sep 19 '22 20:09

Yakk - Adam Nevraumont