Usage of C++20/23

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Usage of C++20/23

Post by adrianinsaval »

A portable version exists, if you are not happy with it and want to discuss that, make a new topic or continue on another existing topic about that please since it's too separate from the main topic here: compiler compatibility with C++ standards
chennes wrote: Sat Feb 04, 2023 8:32 pm This should not be true, @wmayer and I did some work in this area last year and last time I checked it worked well. Maybe something has changed in the interim?
It might just be my information that is outdated, but I vaguely recalled this: viewtopic.php?p=638296#p638296
and besides that it seems gcc doesn't work, only clang, I don't think that's a big issue though: viewtopic.php?p=575983#p575983
xtemp09
Posts: 72
Joined: Tue Jul 12, 2022 2:16 pm

Re: Usage of C++20/23

Post by xtemp09 »

wmayer wrote: Fri Feb 03, 2023 9:57 am
and many more, like std::span
Is also a C++20 feature.
QSpan has been integrated in qt/qtbase, it requires only C++17.
AlexSzatmary
Posts: 4
Joined: Sat Feb 17, 2024 4:10 am
Contact:

Re: Usage of C++20/23

Post by AlexSzatmary »

From this thread, it looks like FreeCAD requires C++17; I also see that in the build guide for Windows but the MacOS build guide says C++14. Is that just a typo on the Mac guide?
xtemp09
Posts: 72
Joined: Tue Jul 12, 2022 2:16 pm

Re: Usage of C++20/23

Post by xtemp09 »

@AlexSzatmary, the first link you provided says:
C++14 is the highest possible for FreeCAD 0.19 while at least C++17 is required for FreeCAD 0.20.
while the other one does not say anything about requirements.
ladis
Posts: 74
Joined: Mon Mar 08, 2021 10:53 am
Location: Hohenelbe, Czechia
Contact:

Re: Usage of C++20/23

Post by ladis »

wmayer wrote: Fri Feb 03, 2023 9:57 am
std::filesystem instead of boost::filesystem
This library has actually been added with C++17 but we postponed the change because it was not fully supported on older systems with a C++17 compiler. So, this should be discussed again.
Note there is class FileInfo, which deserves update probably the most. Work already started, but stalled on setting up Windows and MacOS test environment (Windows is using wchar for path, so that needs some testing)... Unless someone willing to do beta tester for me ;-)
User avatar
chennes
Veteran
Posts: 3879
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Usage of C++20/23

Post by chennes »

Well, if you submit a draft PR the CI will run on Windows... is that enough for your purposes?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply