首页 > 解决方案 > GCC 8.3 无法编译 std::bind_front

问题描述

g++有可能以比我指定的旧标准编译我的程序吗?

我编译:

g++ -Wall -Wextra -pedantic -O3 -std=c++2a -fconcepts

并且编译器无法识别 bind_front 函数(我包括在内<functional>)。编译器版本是 GCC 8.3。

标签: c++compilationstandardsc++20gcc8

解决方案


GCC 8.3 不支持std::bind_front. 在这里检查。

您需要使用 GCC 9.1 或 9.2。在这里检查。

如何安装 GCC 9?

更新

正如@walnut的评论所说,自 Ubuntu 19.04 以来标准存储库中有一个 g++ 9 包。


推荐阅读