Jump to content
PH-Bench

C++ 20 support in C++ Builder

Recommended Posts

I would like to compile some console application examples in C++ builder (Rad Studio 12.3). However, when I run certain examples, I receive this error.

[bcc64x Error] File1.cpp(6): no member named 'format' in namespace 'std'
 

I know the culprit is this line:

using std::format;

My question is can I update C++ Builder to use C++ 20 so that I can run lines like that without error? If so how?
Thanks

Edited by PH-Bench

Share this post


Link to post
20 hours ago, PH-Bench said:

can I update C++ Builder to use C++ 20 so that I can run lines like that without error?

No, you cannot update the compiler. C++Builder simply does not support C++20 at this time, only up to C++17.  Although, the BCC64X 64bit preview compiler does have partial support due to using Clang 15, whereas the other compilers in C++Builder do not as they are still using older Clang versions:

 

https://stackoverflow.com/questions/77456540/does-cbuilder-12-0-support-c20-modules

 

However, you can use the 3rd party {fmt} library, which implements many of C++20's formatting capabilities in pre-20 versions of C++:

 

https://fmt.dev

https://github.com/fmtlib/fmt

Edited by Remy Lebeau

Share this post


Link to post

Hi, thanks for the answer. I am sure this has to be enabled. Could you direct me to instructions to enable it? Thanks

Share this post


Link to post
2 hours ago, PH-Bench said:

Hi, thanks for the answer. I am sure this has to be enabled. Could you direct me to instructions to enable it? Thanks

You can't just "enable" C++20 in C++Builder's current compilers, as it is NOT IMPLEMENTED in any of them at all - except for the BCC64X preview compiler, in which case the page I linked you to earlier tells you how to "enable" it. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×