Log in

View Full Version : C⁺⁺20 issues in gcc 13.0.0


Jamaika
1st December 2022, 10:00
As known C⁺⁺20 should be updated in GCC from version 11 onwards. However does gcc already include C⁺⁺20? The first fixes go to the latest version which is today 13.0.0. Older versions of GCC may not include add-ons because they haven't all the features.
And here the problems begin.
#if __cplusplus >= 202002L
#include <barrier>
#include <bit>
#include <compare>
#include <concepts>
#include <format>
#include <latch>
#include <numbers>
#include <ranges>
#include <span>
#include <stop_token>
#include <semaphore>
#include <source_location>
#include <syncstream>
#include <version>
#include <expected>
#include <spanstream>
#if __has_include(<stacktrace>)
#include <stacktrace>
#endif
#include <stdatomic.h>
#include <stdfloat>
#endif

Which of the added functions are active in GCC. Some i.e. they work with the `std::` prefix.
Inactive functions in gcc 13.0.0 20221130
#include <semaphore>
#include <latch>
Features with multi-system compatibility issues in GCC including 64bit systems. <pthread> functions is only 32bit!
#include <mutex>
#include <thread>
#include <future>
#include <shared_mutex>
#include <condition_variable>
So the addition of mingw-std-thread to GCC is described by the creator as non-standard for which no one is responsible.

The Jungle Book in C⁺⁺20.
There are many libraries on github boasting that even C⁺⁺11 functions can run backwards. The problem is that no one can say whether these are standard functions.
Type Features:
#include <latch>
#include <span>
#include <ranges> are non-standard by other developers and are compatible with gcc, i.e. they can be replaced freely.
Is it caused? Patents, the issue of pay and the approach of creators, the issue of ideas.
A C⁺⁺20 amateur should not add anything because he won't even know what question to ask.

Non-standard libraries:
Note: Mixing non-standard libraries can cause various problems.
mingw_stdthread::detail:: #include<type_traits> for old C⁺⁺11 thread, mutex, future, invoke https://github.com/meganz/mingw-std-threads
#include<latch> https://github.com/luncliff/latch
boost::latch boost::barrier https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html#latch_operations

#include <ranges> https://github.com/ericniebler/range-v3 ranges::span ...
#include <ranges> https://github.com/TartanLlama/ranges
#include <ranges> https://github.com/cor3ntin/rangesnext
#include <ranges> https://github.com/cjdb/cjdb-ranges
#include <numeric> https://github.com/tcbrindle/numeric_ranges tcb:: partial_sum
#include <iterator> https://github.com/tcbrindle/numeric_ranges tcb::rng::iter_reference_t
#include <span> https://github.com/tcbrindle/span tcb::span
#include <span> https://github.com/martinmoene/span-lite nonstd::span
#include <ranges> https://github.com/frengels/hera hera::views hera::tuple_view
#include <format> https://github.com/fmtlib/fmt fmt::format
#include <filesystem> https://github.com/gulrak/filesystem ghc::filesystem
#include <thread> https://github.com/josuttis/jthread mingw+jthread https://github.com/Jamaika1/mingw_std_threads