21
21
#include < __type_traits/is_nothrow_constructible.h>
22
22
#include < __utility/forward.h>
23
23
#include < __utility/move.h>
24
+ #include < __utility/private_constructor_tag.h>
24
25
25
26
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
26
27
# pragma GCC system_header
@@ -49,13 +50,13 @@ class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {
49
50
requires constructible_from<_Callback, _Cb>
50
51
_LIBCPP_HIDE_FROM_ABI explicit stop_callback (const stop_token& __st,
51
52
_Cb&& __cb) noexcept (is_nothrow_constructible_v<_Callback, _Cb>)
52
- : stop_callback(__private_tag {}, __st.__state_, std::forward<_Cb>(__cb)) {}
53
+ : stop_callback(__private_constructor_tag {}, __st.__state_, std::forward<_Cb>(__cb)) {}
53
54
54
55
template <class _Cb >
55
56
requires constructible_from<_Callback, _Cb>
56
57
_LIBCPP_HIDE_FROM_ABI explicit stop_callback (stop_token&& __st,
57
58
_Cb&& __cb) noexcept (is_nothrow_constructible_v<_Callback, _Cb>)
58
- : stop_callback(__private_tag {}, std::move(__st.__state_), std::forward<_Cb>(__cb)) {}
59
+ : stop_callback(__private_constructor_tag {}, std::move(__st.__state_), std::forward<_Cb>(__cb)) {}
59
60
60
61
_LIBCPP_HIDE_FROM_ABI ~stop_callback () {
61
62
if (__state_) {
@@ -74,10 +75,8 @@ class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {
74
75
75
76
friend __stop_callback_base;
76
77
77
- struct __private_tag {};
78
-
79
78
template <class _StatePtr , class _Cb >
80
- _LIBCPP_HIDE_FROM_ABI explicit stop_callback (__private_tag , _StatePtr&& __state, _Cb&& __cb) noexcept (
79
+ _LIBCPP_HIDE_FROM_ABI explicit stop_callback (__private_constructor_tag , _StatePtr&& __state, _Cb&& __cb) noexcept (
81
80
is_nothrow_constructible_v<_Callback, _Cb>)
82
81
: __stop_callback_base([](__stop_callback_base* __cb_base) noexcept {
83
82
// stop callback is supposed to only be called once
0 commit comments