{ return compare_exchange_strong(__e, __i, __m,
__cmpexch_failure_order(__m)); }
-#if __cpp_lib_atomic_wait
- void
- wait(_Tp __old, memory_order __m = memory_order_seq_cst) const noexcept
- {
- std::__atomic_wait_address_v(&_M_i, __old,
- [__m, this] { return this->load(__m); });
- }
+#if __cpp_lib_atomic_wait // C++ >= 20
+ void
+ wait(_Tp __old, memory_order __m = memory_order_seq_cst) const noexcept
+ {
+ std::__atomic_wait_address_v(&_M_i, __old,
+ [__m, this] { return this->load(__m); });
+ }
- // TODO add const volatile overload
+ // TODO add const volatile overload
- void
- notify_one() noexcept
- { std::__atomic_notify_address(&_M_i, false); }
+ void
+ notify_one() noexcept
+ { std::__atomic_notify_address(&_M_i, false); }
- void
- notify_all() noexcept
- { std::__atomic_notify_address(&_M_i, true); }
+ void
+ notify_all() noexcept
+ { std::__atomic_notify_address(&_M_i, true); }
#endif // __cpp_lib_atomic_wait
};
#include <ios>
#include <bits/ostream_insert.h>
+#include <bits/version.h> // __glibcxx_syncbuf
namespace std _GLIBCXX_VISIBILITY(default)
{
return std::move(__os);
}
-#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI
+#ifdef __glibcxx_syncbuf // C++ >= 20 && HOSTED && CXX11ABI
template<typename _CharT, typename _Traits>
class __syncbuf_base : public basic_streambuf<_CharT, _Traits>
{
__os.flush();
return __os;
}
-
-#endif // C++20
+#endif // __glibcxx_syncbuf
#endif // C++11