The <condition_variable>, <mutex>, and <shared_mutex> headers use
std::errc constants, but don't use std::system_error itself. They only
use the __throw_system_error(int) function, which is defined in
<bits/functexcept.h>.
By including the header for the errc constants instead of the whole of
<system_error> we avoid depending on the whole std::string definition.
libstdc++-v3/ChangeLog:
* include/bits/std_mutex.h: Remove <system_error> include.
* include/std/condition_variable: Add <bits/error_constants.h>
include.
* include/std/mutex: Likewise.
* include/std/shared_mutex: Likewise.
# include <bits/c++0x_warning.h>
#else
-#include <system_error>
#include <bits/functexcept.h>
#include <bits/gthr.h>
#else
#include <bits/chrono.h>
+#include <bits/error_constants.h>
#include <bits/std_mutex.h>
#include <bits/unique_lock.h>
#include <bits/alloc_traits.h>
{
return __p();
}
-
+
std::stop_callback __cb(__stoken, [this] { notify_all(); });
shared_ptr<mutex> __mutex = _M_mutex;
while (!__p())
#include <tuple>
#include <exception>
#include <type_traits>
-#include <system_error>
#include <bits/chrono.h>
+#include <bits/error_constants.h>
#include <bits/std_mutex.h>
#include <bits/unique_lock.h>
#if ! _GTHREAD_USE_MUTEX_TIMEDLOCK
#if __cplusplus >= 201402L
#include <bits/chrono.h>
+#include <bits/error_constants.h>
#include <bits/functexcept.h>
#include <bits/move.h> // move, __exchange
#include <bits/std_mutex.h> // defer_lock_t