Why synchronized_value was not added to C++17/C++20?

Viewed 817

I am a bit confused on the status of synchronized_value, on one hand it is suggested in CppCoreGuidelines, but on the other it is not available in C++20, there is not even a boost version(there is experimental one).

Note: I know standardization takes time, but paper is from 2014.

I am mostly concerned if there were some issues discovered during standardization process, so synchronized_value should not be used, contrary to Core Guidelines.

CP.50: Define a mutex together with the data it guards. Use synchronized_value where possible Reason

It should be obvious to a reader that the data is to be guarded and how. This decreases the chance of the wrong mutex being locked, or the mutex not being locked.

Using a synchronized_value ensures that the data has a mutex, and the right mutex is locked when the data is accessed. See the WG21 proposal to add synchronized_value to a future TS or revision of the C++ standard.

0 Answers
Related