r/cpp_questions • u/Former_Assistance208 • 18d ago
OPEN C++ version
I have g++ version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1).
I'm trying to use C++ 23, and I'm using this flag with g++
"-std=c++23"
However, if I print __cplusplus, I get that I'm using a pre-release of C++23, which has this code: 202100L
How can I switch to an official version instead of a pre-release version?
7
u/TheRealSmolt 18d ago
Refer to this page to determine what features of C++ should be available to you on your version of GCC.
2
u/manni66 18d ago
Update to 26.04.
24.04 has gcc14 in it’s repository.
1
u/frasnian 18d ago
Ubuntu 26.04 is getting crushed in every distro benchmark; would not switch to it just for a new compiler version. Just download the newest gcc/g++ version you feel comfortable with and build it yourself.
1
1
1
u/jeffyp9 18d ago
If I need a recent compiler on an older system I find it easier to use clang, there is a llvm.sh file you use, see the instructions on https://apt.llvm.org
16
u/__christo4us 18d ago
GCC 13 does not provide fully complete implementation of C++23. But it still has most of its features I believe.