Use C++ standard library components instead of the custom implementations in CTA/common/
Problem
When the CTA project started being developed (around 10 years ago) several of the C++ standard library components were not yet available to us (as they were only introduced with C++11 and more recent versions).
As a result, most of these components (threads, synchronisation primitives, etc.) had to be implemented by us, usually on top of POSIX.
However, since then we have moved to much more recent C++ standards (with a recent upgrade to C++20 - #1254 (closed)). This means that most of these functions are no longer necessary and can be replaced by their C++ standard equivalents.
As pointed out by @mdavis in this comment:
in the rest of CTA we are using our own thread implementation (in
common/threading
). That's for historical reasons (std::thread
is a C++11 feature, which was not available to us when the project started) but perhaps now we should clean up and standardise. Let's bring this topic up in a dev meeting.
Objective
We can split this work into the following tasks:
- Look into the
CTA/common/
directory and list all the components that can be replaced by their modern C++ (C++17/20) equivalents. Check also SonarCloud for suggestions (link) on this and other directories. - Evaluate the effort required to implement each of these changes and review with the team.
- Implement.