How do I build gcc with C++ concepts (quot;concepts litequot;) support?(如何使用 C++ 概念(“concepts lite)支持构建 gcc?)
问题描述
C++ 标准委员会正在制定概念扩展的 TS(技术规范):编程语言 - 概念的 C++ 扩展".N4377 是最新版本文档.为了包含在 C++ 标准中,要求实现功能,理想情况下是可公开访问的系统.
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.
我知道 concept-gcc 但上面的概念提案(俗称Concepts Lite)是不同的.我听说有一个概念分支,我尝试了 的 origin/asutton/c++-concepts
gcc 的 git
镜像,但没有编译.如何构建和使用上述 [draft] TS 中指定的 gcc 支持概念版本?
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?
推荐答案
根据 Andrew Sutton 的说法,Concepts Lite 工作的 git 镜像已完全过时,不应使用.gcc 实现concepts-lite"的 svn 存储库中有一个概念分支(有一个 pre-C++11 向 C++ 添加概念的努力已被放弃;使用名称概念精简版开始向 C++ 添加概念的新努力).构建起来相当简单(假设您已经安装了最近的 gcc 及其依赖的软件包;请参阅 gcc 安装说明了解您可能想要传递的其他选项:以下说明对我有用,除了我明确指出 配置
在gmp, mpc 和 mpfr 已安装):
According to Andrew Sutton the git mirror of the Concepts Lite work is entirely out of date and shouldn't be used. There is a concepts branch in the svn repository for gcc implementing "concepts-lite" (there was a pre-C++11 effort to add concepts to C++ which was abandoned; a new effort to add concepts to C++ was started using the name concepts lite). It is fairly straight forward to build (assuming you already have a recent gcc and the packages it depends on installed; see the gcc install instruction for other options you might want to pass: the instructions below worked for me except that I explicitly pointed configure
at the locations where gmp, mpc, and mpfr are installed):
cd <suitable-directory>
svn checkout svn://gcc.gnu.org/svn/gcc/branches/c++-concepts
mkdir build-concepts
cd build-concepts
../c++-concepts/configure --prefix=<concept-gcc-root> --disable-bootstrap --enable-languages=c,c++
make -j8
make install
不完全清楚的是如何实际使用 概念:选项-fconcepts
确实存在,但似乎无条件地做一些不同于启用concepts-lite 的事情.相反,在启用概念的情况下进行编译时,您将使用 -std=c++1z
选项.
What isn't entirely obvious is how to actually use concepts: the option -fconcepts
does exist but seems to unconditionally do something different than enabling concepts-lite. Instead, you'd use the -std=c++1z
option when compiling with concepts enabled.
这篇关于如何使用 C++ 概念(“concepts lite")支持构建 gcc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 C++ 概念(“concepts lite")支持构建 gcc?
基础教程推荐
- 运算符重载的基本规则和习语是什么? 2022-10-31
- 设计字符串本地化的最佳方法 2022-01-01
- 如何定义双括号/双迭代器运算符,类似于向量的向量? 2022-01-01
- 您如何将 CreateThread 用于属于类成员的函数? 2021-01-01
- C++,'if' 表达式中的变量声明 2021-01-01
- 如何在 C++ 中处理或避免堆栈溢出 2022-01-01
- C++ 标准:取消引用 NULL 指针以获取引用? 2021-01-01
- 什么是T&&(双与号)在 C++11 中是什么意思? 2022-11-04
- 调用std::Package_TASK::Get_Future()时可能出现争用情况 2022-12-17
- C++ 程序在执行 std::string 分配时总是崩溃 2022-01-01