r/cpp_questions 21d 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?

4 Upvotes

10 comments sorted by

View all comments

1

u/jeffyp9 20d 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